G
Guest
During a postback event, I am having trouble retrieving the state of a
CheckBox Control that I am dynamically adding to a DataGrid Control using
ASP.NET 1.1.
I have no trouble adding the TemplateColumn dynamically. I persist a DataSet
in my Session object and I bind the CheckBox to the DataSet. So far so good.
The CheckBoxes show up and the user interacts with them (checks a few,
unchecks a few).
The problem is that during a postback event, I want to update the DataSet
with the results of what the user did to those CheckBoxes. Problem is, that
during postback (eg, when a Button is clicked), the DataGrid.Items collection
and DataGrid.Columns collection no longer has any knowledge of the
dynamically added TemplateColumn.
I tried setting the CheckBox.EnableViewState = true when I create the
TemplateColumn, but I can't figure out how to get at the dynamically added
CheckBox Controls during postback. Anyone know how to do this?
I have no trouble if I declaratively add the CheckBox TemplateColumns. If I
do that, I can get exactly what I want during postback. But no go when I
create the TemplateColumns dynamically.
Thanks,
Pete
CheckBox Control that I am dynamically adding to a DataGrid Control using
ASP.NET 1.1.
I have no trouble adding the TemplateColumn dynamically. I persist a DataSet
in my Session object and I bind the CheckBox to the DataSet. So far so good.
The CheckBoxes show up and the user interacts with them (checks a few,
unchecks a few).
The problem is that during a postback event, I want to update the DataSet
with the results of what the user did to those CheckBoxes. Problem is, that
during postback (eg, when a Button is clicked), the DataGrid.Items collection
and DataGrid.Columns collection no longer has any knowledge of the
dynamically added TemplateColumn.
I tried setting the CheckBox.EnableViewState = true when I create the
TemplateColumn, but I can't figure out how to get at the dynamically added
CheckBox Controls during postback. Anyone know how to do this?
I have no trouble if I declaratively add the CheckBox TemplateColumns. If I
do that, I can get exactly what I want during postback. But no go when I
create the TemplateColumns dynamically.
Thanks,
Pete