Checkbox not getting set

T

tshad

I can't seem to get my checkboxes to get checked for some reason.

I have 2 Datagrids and they are named Datagrid1 and Datagrid2.

My code is:

*******************************************************************************
theGrid = DataGrid1
if (sendor.id = "CheckAll2") or (sendor.id = "UnCheckAll2") then theGrid =
DataGrid2

for each oItem as DataGridItem in theGrid.items
theCheckBox = CType(oItem.FindControl("FullNameCheckBox"),CheckBox)
if (sendor.id = "CheckAll1") or (sendor.id = "CheckAll2") then
trace.warn("Setting Check to true theGrid.id = " & theGrid.id)
theCheckBox.Checked = true
else
theCheckBox.Checked = false
end if
Next
*******************************************************************************

The trace shows I am setting the control and am pointing at the correct
datatgrid. I normally don't have a problem setting the checkbox when
setting it from a value out of my Sql Statement.

Why doesn't this work?

Thanks,

Tom.
 
T

tshad

Patrick.O.Ige said:
Tom do you mean when u try to check them they are not ticked?

Not really. What seemed to be happening was that they were showing on the
screen as not being checked (ticked).

I actually found the problem a few minutes ago.

They were getting set and then cleared cleared when I rebound the grid and
hadn't realized that was happening. I didn't realize that that would reset
the checkboxes.

Thanks,

Tom
 
T

tshad

I just took out the rebind of the Grid (which was on the postback) and it
worked fine.

Thanks,

Tom
 

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,772
Messages
2,569,593
Members
45,104
Latest member
LesliVqm09
Top