problem with Gridview header checkbox and checkbox column
-
i have a master page and content page in content page i have a girdview inside gridview headerRow i have CheckBox and checkbox column when user click header checkbox then allcheck box in the column should check and when header checkbox uncheck then all checkbox in the column should uncheck.
-
i have a master page and content page in content page i have a girdview inside gridview headerRow i have CheckBox and checkbox column when user click header checkbox then allcheck box in the column should check and when header checkbox uncheck then all checkbox in the column should uncheck.
public void Checkbox_CheckedChanged(object sender,System.EventArgs e) { CheckBox chkbx=new CheckBox(); chkbx=(CheckBox)sender; if(chkbx.Checked==true) { foreach(DataGridItem dgi in DataGrid1.Items) { ((CheckBox)dgi.FindControl("check")).Checked=true; } } else if(chkbx.Checked==false) { foreach(DataGridItem dgi in DataGrid1.Items) { ((CheckBox)dgi.FindControl("check")).Checked=false; } } } And The Html Code Should Be I think this code helps you. VanithaVasu