ItemCommand in Nested Control ?
hi,
in my project ive nested databaound control as
<asp:repeater...>
...
<asp:datagrid...>
<itemtemplate>
<asp:button id="btn"...>
</itemtemplate>
</asp:datagrid>
</asp:repeater>
if click the button btn it doesnt fires btn_itemcommand.
how to handle the itemcommand 4 innermost (datagrid) control?
pls give me idea ?
v.r.mahedran
Re: ItemCommand in Nested Control ?
Hi,
In case of Nested controls you need to make use of the unique client id created during the runtime...I had a similar senario but different controls..may be this is of a bit help for you...
In my Case i used nested datagrids.. a parent datagrid and a child datagrid.
i noticed that the controls inside the child datagrid raised the post back but how to catch the events ?? thats where unique client ids came into existence... I created a temporary datagrid and assiged its client id to the the datagrid that raised the event...to get the client id of the child you need to manipulate the ids in the parents' item created event..
after this the task is simple with programming the temp datagrids' itemcommand ...
if you need i can send the code for the same...
regards,
ssmantha.
Re: ItemCommand in Nested Control ?
One more important thing I added an item command handler at the parents item created event for the child datatgrids..