Accessing a parent web form control from within a nested user control?

Discussion in 'ASP .Net' started by Roy, Feb 9, 2005.

  1. Roy

    Roy Guest

    How is it done? BTW, I'm reposting this here, as the datagrid newsgroup
    appears functionally comatose...

    I have a nested datagrid setup. When one updates the child grid using
    edit, it also updates a field in the parent grid (the parent grid
    update is done using a simple select query inside the child grid's
    update sub). All is well, *however* after the update occurs the parent
    grid is still displaying the old data even though the update has
    occured. I was under the assumption that when I did a .databind() on
    the child grid, the parent grid automatically reloaded? Well, evidently
    it doesn't. :-/ In order to see the right data in the parent grid, I
    have to leave the page then come back.

    What do I do to get the parent grid to display the current data after
    updating the child grid? I've tried many differents ways of getting
    access to the parent grid from within the child grid's update sub, but
    all have met with failure. Help!
     
    Roy, Feb 9, 2005
    #1
    1. Advertising

  2. Roy

    Scott Allen Guest

    Every web control contains a property by the name of Parent - that's
    one way. You might consider an alternative approach: raise an event.
    Then the parent data grid can subscribe to the event and react if need
    be, otherwise you'll have a tighter coupling between the two grids.

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On 9 Feb 2005 04:30:14 -0800, "Roy" <> wrote:

    >How is it done? BTW, I'm reposting this here, as the datagrid newsgroup
    >appears functionally comatose...
    >
    >I have a nested datagrid setup. When one updates the child grid using
    >edit, it also updates a field in the parent grid (the parent grid
    >update is done using a simple select query inside the child grid's
    >update sub). All is well, *however* after the update occurs the parent
    >grid is still displaying the old data even though the update has
    >occured. I was under the assumption that when I did a .databind() on
    >the child grid, the parent grid automatically reloaded? Well, evidently
    >it doesn't. :-/ In order to see the right data in the parent grid, I
    >have to leave the page then come back.
    >
    >What do I do to get the parent grid to display the current data after
    >updating the child grid? I've tried many differents ways of getting
    >access to the parent grid from within the child grid's update sub, but
    >all have met with failure. Help!
     
    Scott Allen, Feb 10, 2005
    #2
    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. Curt_C [MVP]
    Replies:
    0
    Views:
    419
    Curt_C [MVP]
    Jul 12, 2004
  2. Marina
    Replies:
    1
    Views:
    5,570
    Steven Cheng[MSFT]
    Jul 13, 2004
  3. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    562
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  4. nass
    Replies:
    1
    Views:
    581
  5. Ultrus
    Replies:
    3
    Views:
    383
    Stefan Behnel
    Jul 9, 2007
Loading...

Share This Page