How to get checkbox value in gridview

Posted by Oswaldlily under ASP.NET on 5/30/2012 | Points: 10 | Views : 14182 | Status : [Member] | Replies : 5
even if my checkbox checked insde gridview this condtion not satisfying means not enterin if loop.
what could be reason.Is it correct way to get checkbox id in gridview
public void name()
{
foreach (GridViewRow g in ((GridView)(Session["gview"])).Rows)
{
if (((CheckBox)g.FindControl("chkSelect")).Checked==true)
{
str1[i] = ((System.Web.UI.WebControls.Label)g.FindControl("lbl1")).Text;
str2[i] = ((System.Web.UI.WebControls.Label)g.FindControl("lbl2")).Text;
i++;
}
}
}




Responses

Posted by: Vforvijay on: 5/30/2012 [Member] Starter | Points: 25

Up
0
Down
Hi..
refer the below links......
http://www.dotnetcode.in/2011/06/delete-multiple-recordsrows-in-grid.html

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajay.Kalol on: 5/30/2012 [Member] Starter | Points: 25

Up
0
Down
check it by putting break point,
check that why if condition getting false.

you will find your solution

Ajay
ajaypatelfromsanthal.blogspot.in

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chikkanti on: 5/31/2012 [Member] Starter | Points: 25

Up
0
Down
hi...
http://chikkanti.wordpress.com/2011/10/23/select-all-checkbox-in-gridview/

chikkanti

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shanky11 on: 3/6/2013 [Member] Starter | Points: 25

Up
0
Down
i need this in vb.net windows app
datagriedview

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response