Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Check Box

Check Box

Scheduled Pinned Locked Moved ASP.NET
databasetutorialquestion
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    senthilsstil
    wrote on last edited by
    #1

    Hi Friends, I have one doubt,i having a web page then i m having number of check boxes.In that checkboxes i have checked some checkboxes,how to store the checked one to the database in a single column and how to count number of checkboxes are checked in a web page.Kindly tell me how to find? Thank You Take Care Thanks & Regards Senthil Kumar

    P P R 3 Replies Last reply
    0
    • S senthilsstil

      Hi Friends, I have one doubt,i having a web page then i m having number of check boxes.In that checkboxes i have checked some checkboxes,how to store the checked one to the database in a single column and how to count number of checkboxes are checked in a web page.Kindly tell me how to find? Thank You Take Care Thanks & Regards Senthil Kumar

      P Offline
      P Offline
      Pankaj Garg
      wrote on last edited by
      #2

      Suppose u have the sixth column as a checkbox column then do the following. for (int count = 0; count < a.Rows.Count; count++) { CheckBox c = (CheckBox)grdsubbassinfo.Rows[count].Cells[5].FindControl("ch1"); }

      If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

      S 2 Replies Last reply
      0
      • S senthilsstil

        Hi Friends, I have one doubt,i having a web page then i m having number of check boxes.In that checkboxes i have checked some checkboxes,how to store the checked one to the database in a single column and how to count number of checkboxes are checked in a web page.Kindly tell me how to find? Thank You Take Care Thanks & Regards Senthil Kumar

        P Offline
        P Offline
        Paddy Boyd
        wrote on last edited by
        #3

        How are you outputting the checkboxes? Is it in a checkboxlist, or are they individual.

        S 1 Reply Last reply
        0
        • P Paddy Boyd

          How are you outputting the checkboxes? Is it in a checkboxlist, or are they individual.

          S Offline
          S Offline
          senthilsstil
          wrote on last edited by
          #4

          it is individual checkbox

          P 1 Reply Last reply
          0
          • P Pankaj Garg

            Suppose u have the sixth column as a checkbox column then do the following. for (int count = 0; count < a.Rows.Count; count++) { CheckBox c = (CheckBox)grdsubbassinfo.Rows[count].Cells[5].FindControl("ch1"); }

            If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

            S Offline
            S Offline
            senthilsstil
            wrote on last edited by
            #5

            hi pankaj, thanks for reply,i have one doubt what is 'a'which mentioned above.Rows.Count means to count the rows what is "a". Take Care Thanks & Regards Senthil Kumar

            1 Reply Last reply
            0
            • P Pankaj Garg

              Suppose u have the sixth column as a checkbox column then do the following. for (int count = 0; count < a.Rows.Count; count++) { CheckBox c = (CheckBox)grdsubbassinfo.Rows[count].Cells[5].FindControl("ch1"); }

              If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

              S Offline
              S Offline
              senthilsstil
              wrote on last edited by
              #6

              Sorry Pankaj,i m not having the checkboxes in the grid.

              1 Reply Last reply
              0
              • S senthilsstil

                it is individual checkbox

                P Offline
                P Offline
                Paddy Boyd
                wrote on last edited by
                #7

                Not too sure exactly what you are doing here, I have a feeling there may be a better way. If you have random numbers of checkboxes on your page, you could potentially loop through the Controls collection of the Page and find look at the checked values for all controls of type CheckBox.

                1 Reply Last reply
                0
                • S senthilsstil

                  Hi Friends, I have one doubt,i having a web page then i m having number of check boxes.In that checkboxes i have checked some checkboxes,how to store the checked one to the database in a single column and how to count number of checkboxes are checked in a web page.Kindly tell me how to find? Thank You Take Care Thanks & Regards Senthil Kumar

                  R Offline
                  R Offline
                  ram1974
                  wrote on last edited by
                  #8

                  Hi senthil, You can grab all the values of the check boxes into a string something like below. 0,1,1,0,0 or false, true, true, false, false store it as a sting to the DB and when you read back use split() and get the values back. -ram.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups