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

R

Roy

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!
 
S

Scott Allen

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top