Checkbox Datagrid

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top