Postbacks with parent/child datagrid controls

Discussion in 'ASP .Net Web Controls' started by Danny Sikora, Feb 11, 2005.

  1. Danny Sikora

    Danny Sikora Guest

    Hello,

    I have a datagrid on a .aspx page, and another datagrid on a .ascx page. My
    goal is to populate the "child" datagrid (the one from the control) depending
    on the selected index of the parent datagrid. The child control gets the
    DataKeyField of the selected index of the datagrid from the parent page to
    use to populate it's datagrid.

    So, when I call a sort, edit, or whatever from the child datagrid, it fires
    a postback to the parent page, and so I have to reload the control in the
    page_load area of of the parent page....fine so far.

    My problem comes when I select a new item from the parent datagrid. The
    page posts back, and then it reloads my child control, but it still has the
    ID from the previously selected Item because it reloads the control before it
    fires the DataGrid.OnSelectCommand function.

    I tried to clear the placeholder that I load the control into, and reload
    the control. This sort-of works...at this point there is 2 controls (one
    loaded from page_load, and one from the selected index changed), but only one
    is visible.

    Is there a way to actually DELETE or UNLOAD a control from the page or
    placeholder, and actually reload it, as opposed to the placeHolder.Clear()
    function?

    Thanks,

    Danny
     
    Danny Sikora, Feb 11, 2005
    #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. Arulraja
    Replies:
    3
    Views:
    1,405
    William F. Robertson, Jr.
    Oct 17, 2003
  2. Replies:
    0
    Views:
    479
  3. Replies:
    0
    Views:
    220
  4. Noel Dolan
    Replies:
    0
    Views:
    275
    Noel Dolan
    Jul 18, 2004
  5. Bitswapper
    Replies:
    5
    Views:
    183
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page