A
Arthur.Net
I am having trouble finding a checkbox control within a formview. I
can find other textboxes and such in here. Any ideas?
Here is the form simplified:
<asp:FormView ID="formCategory" runat="server"
DataSourceID="dsCategoryForm">
<ItemTemplate>
<asp:CheckBoxList ID="chkUDF" runat="server"
DataSourceID="dsUDFchk" DataTextField="FieldNameStr"
DataValueField="BaseUDFID"></asp:CheckBoxList>
</ItemTemplate>
</asp:FormView>
Here is the code that runs:
CheckBoxList _chkUDF =
(CheckBoxList)formCategory.FindControl("chkUDF");
foreach (ListItem chk in _chkUDF.Items)
{
chk.Selected = false;
}
can find other textboxes and such in here. Any ideas?
Here is the form simplified:
<asp:FormView ID="formCategory" runat="server"
DataSourceID="dsCategoryForm">
<ItemTemplate>
<asp:CheckBoxList ID="chkUDF" runat="server"
DataSourceID="dsUDFchk" DataTextField="FieldNameStr"
DataValueField="BaseUDFID"></asp:CheckBoxList>
</ItemTemplate>
</asp:FormView>
Here is the code that runs:
CheckBoxList _chkUDF =
(CheckBoxList)formCategory.FindControl("chkUDF");
foreach (ListItem chk in _chkUDF.Items)
{
chk.Selected = false;
}