J
jdbss
I'm using an unbound checkbox within a datagrid, listed below, and setting
the initial value during page_load based upon some critieria. The problem is
when I "Uncheck" a value that was selected/checked during the page_load, the
value is represented as checked regardless.
<asp:TemplateColumn>
<ItemTemplate>
<input id="cbSelected" onclick="URow(this)" type="checkbox"
runat="Server" />
</ItemTemplate>
/asp:TemplateColumn>
For Each dRow In dataTable
For Each fld In tFieldsDataGrid.Items
If (fld.ItemType = ListItemType.Item) Or _
(fld.ItemType = ListItemType.AlternatingItem) Then
cb = fld.FindControl("cbSelected")
If (fld.Cells(2).Text = dRow.FieldID) Then
Dim cFlds As New cFields
cFlds.FieldName = fld.Cells(2).Text
cFlds.ActiveField = True
cFlds.NewField = False
colFields.Add(cFlds, fld.Cells(2).Text)
cb.Checked = True
fld.BackColor = BC.ConvertFromString("#ffcccc")
End If
End If
Next
Next
the initial value during page_load based upon some critieria. The problem is
when I "Uncheck" a value that was selected/checked during the page_load, the
value is represented as checked regardless.
<asp:TemplateColumn>
<ItemTemplate>
<input id="cbSelected" onclick="URow(this)" type="checkbox"
runat="Server" />
</ItemTemplate>
/asp:TemplateColumn>
For Each dRow In dataTable
For Each fld In tFieldsDataGrid.Items
If (fld.ItemType = ListItemType.Item) Or _
(fld.ItemType = ListItemType.AlternatingItem) Then
cb = fld.FindControl("cbSelected")
If (fld.Cells(2).Text = dRow.FieldID) Then
Dim cFlds As New cFields
cFlds.FieldName = fld.Cells(2).Text
cFlds.ActiveField = True
cFlds.NewField = False
colFields.Add(cFlds, fld.Cells(2).Text)
cb.Checked = True
fld.BackColor = BC.ConvertFromString("#ffcccc")
End If
End If
Next
Next