Hello,
It is not clear for me how many CheckBoxes you are using. string itm = row.Items[0].text will not return what you would expect.
However, if what you would like to get is the checked status of the checkBoxes when using TemplateDataField and ItemTemplate, you could find these template controls at the server using the following approach. You could use the checkBox.Checked status and set the values in the DB as true-false, 0-1 or 1-2 or else based on the logic required.
Lets say you have the following markup
<ig:TemplateDataField Key="Asd">
<ItemTemplate>
<asp:CheckBox runat="server" ID="CheckBox1" Checked="true" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="true" ClientIDMode="AutoID"/> </ItemTemplate>
/ig:TemplateDataField>
And in code behind you could access all checkboxes iterating each row and find the checked status:
if (IsPostBack)
{
foreach (GridRecord row in WebDataGrid1.Rows)
{
CheckBox checkBox= (CheckBox)row.Items.FindItemByKey("Asd").FindControl("CheckBox1");
bool isChecked = checkBox.Checked;
}
}
In case you would like to do PostBack immediately after a checkbox status is changed/clicked, you could handle OnCheckedChanged="CheckBox1_CheckedChanged for example.
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
CheckBox checkBox = (CheckBox)sender;
bool isChecked = checkBox.Checked;
}