Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False

A

Amar

I have created a Template Column and Added to a Datagrid, which
contains a checkBox. The column is not Binded to any column of the
Dataset, but is an extra one so i can retrieve on Save Button which
rows are selected and make the necessary work. The problem is that my
page has 3 states. The 1 one is when form is first loaded. When i
click the Save button the Page goes to state 2 and the DataGrid must
become Enabled = false, in order to ask from the user a confirmation
about the data, and finally when Save button is clicked again the
transaction must take place. At that point when i try to determine
which check boxes are selected through (which is correct):

foreach(DataGridItem mItem in CAssigned.Items){
CheckBox mBox = (CheckBox)cItem.Cells[CAssigned.GetCheckBoxColumnIndex()].Controls[0];
if (mBox.Checked){
countCheckBox ++;
}
}
all the checkboxes are unselected.

WHEN i don't make DataGrid Enabled = false and leave it always enabled
i get always the correct values at the 3rd state of my form. Maybe
something is going wrong with Enabled property of the DataGrid?

Please Help!.
 

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

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top