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. How can i get template field control in GridView

How can i get template field control in GridView

Scheduled Pinned Locked Moved ASP.NET
csharphelpquestion
3 Posts 2 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
    SunithaNallana
    wrote on last edited by
    #1

    :(Hi everybody anybody help me!!! i am having a gridview,in which i placed a template field which contains a checkbox control.My need is to find whether this checkbox is checked or not. pls help me in coding(using c#) SunithaNallana

    M 1 Reply Last reply
    0
    • S SunithaNallana

      :(Hi everybody anybody help me!!! i am having a gridview,in which i placed a template field which contains a checkbox control.My need is to find whether this checkbox is checked or not. pls help me in coding(using c#) SunithaNallana

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      Code from this article.. // StringBuilder object StringBuilder str = new StringBuilder(); // Select the checkboxes from the GridView control for (int i = 0; i < GridView1.Rows.Count; i++) { GridViewRow row = GridView1.Rows[i]; bool isChecked = ((CheckBox) row.FindControl("chkSelect")).Checked; if (isChecked) { // Column 2 is the name column str.Append(GridView1.Rows[i].Cells[2].Text); } } hope it helps..

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."

      S 1 Reply Last reply
      0
      • M Michael Sync

        Code from this article.. // StringBuilder object StringBuilder str = new StringBuilder(); // Select the checkboxes from the GridView control for (int i = 0; i < GridView1.Rows.Count; i++) { GridViewRow row = GridView1.Rows[i]; bool isChecked = ((CheckBox) row.FindControl("chkSelect")).Checked; if (isChecked) { // Column 2 is the name column str.Append(GridView1.Rows[i].Cells[2].Text); } } hope it helps..

        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."

        S Offline
        S Offline
        SunithaNallana
        wrote on last edited by
        #3

        Thank u very much sir... its working. SunithaNallana

        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