D
drakuu
Hi guys,
I created DataGrid with few checkboxes. I want to bind the checkboxes
and check them if they match a string in a database. An if statement
would look something like this:
if (dataRowChb["AddressTypeCode"].ToString() == "u") checkbox1.checked
= true
Now how would I do it in datagrid using TemplateField:
<asp:TemplateField>
<EditItemTemplate>
<asp:CheckBox ID="CheckBoxU" runat="server" />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBoxU" runat="server"
Text='<%# Eval("AddressTypeCode") %>' />
</ItemTemplate>
</asp:TemplateField>
I'll have 5 checkboxes each for unique character (u, a, c...) and if
there exist AddressId with that AddressTypeCode the check box should be
checked.
Thanks,
draku
I created DataGrid with few checkboxes. I want to bind the checkboxes
and check them if they match a string in a database. An if statement
would look something like this:
if (dataRowChb["AddressTypeCode"].ToString() == "u") checkbox1.checked
= true
Now how would I do it in datagrid using TemplateField:
<asp:TemplateField>
<EditItemTemplate>
<asp:CheckBox ID="CheckBoxU" runat="server" />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBoxU" runat="server"
Text='<%# Eval("AddressTypeCode") %>' />
</ItemTemplate>
</asp:TemplateField>
I'll have 5 checkboxes each for unique character (u, a, c...) and if
there exist AddressId with that AddressTypeCode the check box should be
checked.
Thanks,
draku