CheckBox inside DataGrid problem

Discussion in 'ASP .Net Datagrid Control' started by popobawa61, Oct 2, 2003.

  1. popobawa61

    popobawa61 Guest

    I have a DataGrid (ID=DataGrid1) and a PlaceHolder on an aspx page. In
    the Init phase of the page, I dynamically add a template column
    containing a CheckBox to DataGrid1. In the Load phase of the page, I
    instantiate a DataGrid (ID=DataGrid2), add a template column
    containing a checkbox to that grid and then add the DataGrid to the
    placeholder.

    The 1st time the page is hit, no CheckBoxes are selected in either
    grid. Using my browser, I select a CheckBox in both of the grids, then
    navigate to another page in one of the grids, forcing a postback to
    the server.

    My server code checks to see if any of the CheckBoxes are checked
    within either of the grids. I perform this check in 2 phases of the
    page lifecycle:
    1: Page_Load (after adding DataGrid2 to the PlaceHolder on the page)
    2: the event handler for the clicking on a page of the DataGrid.

    For DataGrid2, the CheckBox reflects my client-side check only in case
    #2, whereas DataGrid1 reflects my client-side check in both case 1 &
    2.

    It is my understanding that when a control is added to a page, it
    plays catch-up within the page life cycle until it reaches the current
    phase of the page. Since the page is in the Load phase when I added
    DataGrid2 to it, DataGrid2 should have loaded its PostBack data and
    thus reflect the client-side change I made by the time I scan the
    CheckBoxes.

    Does anyone know why my CheckBoxes do not reflect client-side checks I
    made within DataGrid2 within Page_Load?

    Thanks, Popo
    popobawa61, Oct 2, 2003
    #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. mehul
    Replies:
    0
    Views:
    762
    mehul
    May 3, 2004
  2. Mark
    Replies:
    3
    Views:
    1,398
  3. kleykir
    Replies:
    0
    Views:
    431
    kleykir
    Aug 18, 2005
  4. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    802
    David Wier
    Oct 6, 2006
  5. Joey Pang
    Replies:
    4
    Views:
    505
    Joey Pang
    Jun 13, 2005
Loading...

Share This Page