A
arun.hallan
Hi,
I have two columns in a datagrid that are filled with checkboxes.
I want one checkbox in a row to be checked when the corresponding
checkbox is checked.
I've added an OnCheckedChanged event to the checkbox and implemented
the method with the following code:
for (int i = 0; i<this.DataGrid1.Items.Count; i++)
{
CheckBox cb=
(CheckBox)DataGrid1.Items.FindControl("chkContribute");
if (cb.Checked)
{
((CheckBox)DataGrid1.Items.FindControl("chkPrice")).Checked =
true;
}
}
Session["CachedSource"] = this.DataGrid;
But the postback doesnt save the datagrid selections.
Am i doing this correct and if not is there an easier way?
I have two columns in a datagrid that are filled with checkboxes.
I want one checkbox in a row to be checked when the corresponding
checkbox is checked.
I've added an OnCheckedChanged event to the checkbox and implemented
the method with the following code:
for (int i = 0; i<this.DataGrid1.Items.Count; i++)
{
CheckBox cb=
(CheckBox)DataGrid1.Items.FindControl("chkContribute");
if (cb.Checked)
{
((CheckBox)DataGrid1.Items.FindControl("chkPrice")).Checked =
true;
}
}
Session["CachedSource"] = this.DataGrid;
But the postback doesnt save the datagrid selections.
Am i doing this correct and if not is there an easier way?