P
Peter Rilling
I have an interesting problem with a datagrid. It is the standard
chicken-and-the-egg problem.
I have this page with two datagrids. It essentially defines a parent-child
relationship. The parent grid has a "edit" and "delete" columns. When the
"edit" link button is clicked, I want the child grid to display some
information related to the parent. Now the child grid also has some command
buttons.
My problem is that I cannot get the child grid to responded to the command
events. The handlers are never invoked. Here is what I think the problem
is. In order for the handlers to be invoked, the object model for the past
must be the same on postback as was sent to the browser. That means that I
have to initialize both grids their Init events so the command handlers will
be invoked. The problem is, that when the parent grid's edit button is
clicked, the Init fires as expected, but I do not know the ID for the item
that was selected until the EditCommand handler is invoked. At this point,
I could bind the grid and render the appropriate list items. But, if I do
this, then if a command link is clicked on the child grid, the events do not
fire since the grid was not built in the Init event.
Any ideas at how I can solve this, assuming I made any sense?
chicken-and-the-egg problem.
I have this page with two datagrids. It essentially defines a parent-child
relationship. The parent grid has a "edit" and "delete" columns. When the
"edit" link button is clicked, I want the child grid to display some
information related to the parent. Now the child grid also has some command
buttons.
My problem is that I cannot get the child grid to responded to the command
events. The handlers are never invoked. Here is what I think the problem
is. In order for the handlers to be invoked, the object model for the past
must be the same on postback as was sent to the browser. That means that I
have to initialize both grids their Init events so the command handlers will
be invoked. The problem is, that when the parent grid's edit button is
clicked, the Init fires as expected, but I do not know the ID for the item
that was selected until the EditCommand handler is invoked. At this point,
I could bind the grid and render the appropriate list items. But, if I do
this, then if a command link is clicked on the child grid, the events do not
fire since the grid was not built in the Init event.
Any ideas at how I can solve this, assuming I made any sense?