Problem with binding in Page_PreRender

Discussion in 'ASP .Net Datagrid Control' started by PokerJoker, Aug 30, 2004.

  1. PokerJoker

    PokerJoker Guest

    I have narrowed my problem quite a bit but am still having issues making a
    work around.

    I am using a datagrid to display a 2d matrix of users and security levels.
    Different applications have their own applicable security zones, so the
    columns are genereated dynamically with checkboxes to give permissions, for
    example...

    .............level1.......level2.....level3.....level4......remove
    Joe.........chk...........chk........chk.........chk.......remove
    Bob.........chk...........chk........chk.........chk.......remove
    Steve......chk...........chk........chk.........chk.......remove

    The form also has a dropdown of available users to add to the grid. Because
    Page_Load is run before the button event to add a user, I moved to code to
    build the security matrix and bind the grid into Page_PreRender so that newly
    added users will be in the database before the bind occurs.

    The grid itself "looks" like it is working fine. The new user is added to
    the grid, and the correct rows/columns are displaying AOK.

    The problem is that, when I loop through the grid to grab the checkbox
    values, using the following code

    For Each item In myGrid.Items
    .....
    Next

    It skips right over the block, like the grid has no rows. All I need to do
    to make the code work fine, is move the binding of the grid into page_load
    instead of preRender. This is unacceptable because of the issue I described
    above.

    Is there a more accepted work around that I'm not aware of? Or perhaps a
    different way to get the button submit event to run before the grid gets
    bound and retain the state properly on the server?

    Thanks!
     
    PokerJoker, Aug 30, 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. Ashish

    Page_Prerender

    Ashish, Sep 24, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    499
    Ashish
    Sep 24, 2004
  2. Ashish

    page_prerender

    Ashish, Sep 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,872
    Jonathan Allen
    Sep 25, 2004
  3. Sky Sigal
    Replies:
    0
    Views:
    363
    Sky Sigal
    Aug 3, 2004
  4. TPS
    Replies:
    2
    Views:
    3,535
  5. Sparhawk

    Binding Repeater in Page_PreRender

    Sparhawk, Sep 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    513
    Eliyahu Goldin
    Sep 5, 2004
Loading...

Share This Page