I have a datagrid and one of the columns in my datagrid is a textbox.
I used the following code in the itemdatabound event to display checkedon or checkedoff based upon the value 0 or 1:
If e.item.cells(3).text = 1 then
dim checkb as checkbox = new checkbox
checkb = ctype(e.item.findcontrol("checkbox1"),checkbox)
chkb.checked = true
end if
The above code works fine. The problem is that I also have and edit column in my data grid.
I added another checkbox for the edit value of the template button called checkbox2.
I placed the following code in the same event just below the above code:
dim checkb as checkbox = new checkbox
checkb = ctype(e.item.findcontrol("checkbox2"),checkbox)
chkb.checked = true
However, this checkbox in edit mode always appears unchecked, regradless if the value is 0 or 1.
Any suggestions greatly appreciated. Thanks in advance.
I used the following code in the itemdatabound event to display checkedon or checkedoff based upon the value 0 or 1:
If e.item.cells(3).text = 1 then
dim checkb as checkbox = new checkbox
checkb = ctype(e.item.findcontrol("checkbox1"),checkbox)
chkb.checked = true
end if
The above code works fine. The problem is that I also have and edit column in my data grid.
I added another checkbox for the edit value of the template button called checkbox2.
I placed the following code in the same event just below the above code:
dim checkb as checkbox = new checkbox
checkb = ctype(e.item.findcontrol("checkbox2"),checkbox)
chkb.checked = true
However, this checkbox in edit mode always appears unchecked, regradless if the value is 0 or 1.
Any suggestions greatly appreciated. Thanks in advance.