S
Steve Hershoff
Hi everyone,
I've got a strange one here. There are two datagrids on my page, one nested
within the other. I'll refer to them as the topmost and secondary
datagrids.
In the topmost datagrid's OnItemDataBound() method we check for the row in
which it's appropriate to add the secondary datagrid. Exactly one row in
the topmost grid will contain the secondary grid.
When we do find the appropriate row in the topmost grid, we add to one of
its cells a DropDownList and then our secondary datagrid. Meanwhile, within
this secondary datagrid we add a LinkButton to one of its cells, for
specific rows. Not all rows of the secondary grid get a button. We use the
ItemEvent() method to check.
When we add the DropDownList and LinkButtons, we create event handlers for
their SelectedIndexChanged() and Click() events, respectively. Now comes my
problem.
What's strange is that when I click on one of the LinkButtons the page is
reloaded (as expected), but then the DropDownList's SelectedIndexChanged()
handler is fired. I never touched the DropDownList however.
What's more, if I fail to call the secondary datagrid's DataBind() method
from within this DropDownList event handler, the LinkButton's Click()
handler is never called-- even though that's the control I clicked on to
start the chain of events!
So I'm confused to say the least. I realize this stuff can be tricky and
I'm not expecting a total answer to my problem, but does any of this ring a
bell? Specifically, why is the DropDownList's event handler being fired
when the LinkButton is clicked, and why is the LinkButton's Click() handler
never called unless the DropDownList's event handler calls the secondary
datagrid's BindData() method?
Thanks very much.
I've got a strange one here. There are two datagrids on my page, one nested
within the other. I'll refer to them as the topmost and secondary
datagrids.
In the topmost datagrid's OnItemDataBound() method we check for the row in
which it's appropriate to add the secondary datagrid. Exactly one row in
the topmost grid will contain the secondary grid.
When we do find the appropriate row in the topmost grid, we add to one of
its cells a DropDownList and then our secondary datagrid. Meanwhile, within
this secondary datagrid we add a LinkButton to one of its cells, for
specific rows. Not all rows of the secondary grid get a button. We use the
ItemEvent() method to check.
When we add the DropDownList and LinkButtons, we create event handlers for
their SelectedIndexChanged() and Click() events, respectively. Now comes my
problem.
What's strange is that when I click on one of the LinkButtons the page is
reloaded (as expected), but then the DropDownList's SelectedIndexChanged()
handler is fired. I never touched the DropDownList however.
What's more, if I fail to call the secondary datagrid's DataBind() method
from within this DropDownList event handler, the LinkButton's Click()
handler is never called-- even though that's the control I clicked on to
start the chain of events!
So I'm confused to say the least. I realize this stuff can be tricky and
I'm not expecting a total answer to my problem, but does any of this ring a
bell? Specifically, why is the DropDownList's event handler being fired
when the LinkButton is clicked, and why is the LinkButton's Click() handler
never called unless the DropDownList's event handler calls the secondary
datagrid's BindData() method?
Thanks very much.