How can i get template field control in GridView
-
:(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
-
:(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
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."
-
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."
Thank u very much sir... its working. SunithaNallana