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. Retrieving the check box rows from gridview

Retrieving the check box rows from gridview

Scheduled Pinned Locked Moved ASP.NET
help
5 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.
  • M Offline
    M Offline
    mukkanti007
    wrote on last edited by
    #1

    i am trying to add checkbox column to gridview and pick the rows which were selected , while doing this i am not able to get the rows selected, could some one say what could be the problem in the code the code i am working on is added a new check box column to gridview as ; ; ; to retrieve the rows selected i am using the code CheckBox cbCelda = new CheckBox(); int i = 0; while (i < grdViewpapers.Rows.Count) { cbCelda = (CheckBox)grdViewpapers.Rows[i].FindControl("chkassignpaper"); if (cbCelda.Checked) { Response.Write("hi" + i); } i++; } can some one say what could be the problem in accessing rows.....

    Thanks srini

    I L P 3 Replies Last reply
    0
    • M mukkanti007

      i am trying to add checkbox column to gridview and pick the rows which were selected , while doing this i am not able to get the rows selected, could some one say what could be the problem in the code the code i am working on is added a new check box column to gridview as ; ; ; to retrieve the rows selected i am using the code CheckBox cbCelda = new CheckBox(); int i = 0; while (i < grdViewpapers.Rows.Count) { cbCelda = (CheckBox)grdViewpapers.Rows[i].FindControl("chkassignpaper"); if (cbCelda.Checked) { Response.Write("hi" + i); } i++; } can some one say what could be the problem in accessing rows.....

      Thanks srini

      I Offline
      I Offline
      Ibrahim Bello
      wrote on last edited by
      #2

      What error messages are you getting? Have you stepped through your code? Have you populated the gridview with data?

      1 Reply Last reply
      0
      • M mukkanti007

        i am trying to add checkbox column to gridview and pick the rows which were selected , while doing this i am not able to get the rows selected, could some one say what could be the problem in the code the code i am working on is added a new check box column to gridview as ; ; ; to retrieve the rows selected i am using the code CheckBox cbCelda = new CheckBox(); int i = 0; while (i < grdViewpapers.Rows.Count) { cbCelda = (CheckBox)grdViewpapers.Rows[i].FindControl("chkassignpaper"); if (cbCelda.Checked) { Response.Write("hi" + i); } i++; } can some one say what could be the problem in accessing rows.....

        Thanks srini

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        May be change your code like this int i = 0; while (i < grdViewpapers.Rows.Count) { CheckBox cbCelda = (CheckBox)grdViewpapers.Rows[i].FindControl("chkassignpaper"); if(cbCelda != null) { if (cbCelda.Checked) { Response.Write("hi" + i); } } i++; }

        M 1 Reply Last reply
        0
        • L Lost User

          May be change your code like this int i = 0; while (i < grdViewpapers.Rows.Count) { CheckBox cbCelda = (CheckBox)grdViewpapers.Rows[i].FindControl("chkassignpaper"); if(cbCelda != null) { if (cbCelda.Checked) { Response.Write("hi" + i); } } i++; }

          M Offline
          M Offline
          mukkanti007
          wrote on last edited by
          #4

          Hi, Thanks for the quick response, i got the problem solved.

          Thanks Mukkanti

          1 Reply Last reply
          0
          • M mukkanti007

            i am trying to add checkbox column to gridview and pick the rows which were selected , while doing this i am not able to get the rows selected, could some one say what could be the problem in the code the code i am working on is added a new check box column to gridview as ; ; ; to retrieve the rows selected i am using the code CheckBox cbCelda = new CheckBox(); int i = 0; while (i < grdViewpapers.Rows.Count) { cbCelda = (CheckBox)grdViewpapers.Rows[i].FindControl("chkassignpaper"); if (cbCelda.Checked) { Response.Write("hi" + i); } i++; } can some one say what could be the problem in accessing rows.....

            Thanks srini

            P Offline
            P Offline
            padmanabhan N
            wrote on last edited by
            #5

            use this link and see download the sample program... GridView all in one[^]

            Padmanabhan

            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