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

Discussion in 'ASP .Net Building Controls' started by Amar, Apr 6, 2004.

  1. Amar

    Amar Guest

    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!.
    Amar, Apr 6, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabor
    Replies:
    3
    Views:
    616
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. Amar
    Replies:
    0
    Views:
    551
  3. Bennett Haselton
    Replies:
    1
    Views:
    514
    John M Deal
    Nov 8, 2004
  4. Bruce Hodge

    Datagrid Enabled = false - Not Working.

    Bruce Hodge, Oct 29, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    159
    Bruce Hodge
    Oct 29, 2003
  5. CheckBox enabled=false check is always true

    , Mar 29, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    304
Loading...

Share This Page