checked or not...
asp.net using c#
foreach (DataGridItem i in DataGrid1 .Items )
{
CheckBox chk = (CheckBox)i.FindControl ("chkbox");
if (chk.Checked )
{
}
}
// i use this to code to add checkbox in data grid
<
asp:TemplateColumn HeaderText="Approve"> <ItemTemplate> <asp:CheckBox ID="chkbox" Runat="server">asp:CheckBox> ItemTemplate> asp:TemplateColumn>if u not able to understand my question plz ask me i will explain..
it is not working properly..
Blocked AccountPosted Jan 29, 2009, 2:29 AM
Hi,
try this code
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked = ((CheckBox) row.FindControl("chkbox")).Checked;
if (isChecked)
{
}
}