K
KeithRaginF
(I apologize for repeatedly posting this --- I am having a little trouble getting my MSDN Universal Managed Newsgroup ID set-up. Hopefully, this one will result in a response.
I have 1 repeater nested inside another. It looks something like this
<asp:Repeater id="RepeaterOuter" runat="server" DataSource="<%# GetStuffToIterateOver() %"><ItemTemplate><various controls><asp:Repeater id="RepeaterInner" runat="server"
DataSource="<%# Container.DataItem.GetAnArrayOfStrings() %>"><ItemTemplate><asp:LinkButton CommandName='<%# Container.DataItem %>' ID="Linkbutton1" Runat="server"><%# Container.DataItem] %></asp:LinkButton>  &nbs
</ItemTemplate></asp:Repeater></ItemTemplate></asp:Repeater
The outer repeater displays groups of data. Each group contains a series of linkbuttons which are also created by a repeater (the inner repeater). What I can't figure out is how to determine which linkbutton has been clicked. By setting the commandname of the linkbutton, I know which item in the inner repeater caused the event. But, I can't determine from which item in the outer repeater the event came from
I bound the following to the ItemCreated event of the outer repeater to capture events from the inner repeater
private void RepeaterOuter_ItemCreated(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e
Repeater links = e.Item.FindControl("RepeaterInner") as Repeater
links .ItemCommand += new RepeaterCommandEventHandler(this.RepeaterInner_ItemCommand)
Inside RepeaterInner_ItemCommand, I can succesfully interogate e.CommandName to find out which linkbutton was pressed. How do I determine which item in the outer repeater, though
One approach where I hit a dead-end was to embed additional information in the linkbutton tag to identify the outer repeater item. For instance, setting the CommandArgument with something that will identify the item of the outer repeater, except, I don't know how to access it. Is there a way to get at the Container.DataItem of the parent repeater from inside the nested repeater? Or is there a better approach to this
Thanks for any assistance!
I have 1 repeater nested inside another. It looks something like this
<asp:Repeater id="RepeaterOuter" runat="server" DataSource="<%# GetStuffToIterateOver() %"><ItemTemplate><various controls><asp:Repeater id="RepeaterInner" runat="server"
DataSource="<%# Container.DataItem.GetAnArrayOfStrings() %>"><ItemTemplate><asp:LinkButton CommandName='<%# Container.DataItem %>' ID="Linkbutton1" Runat="server"><%# Container.DataItem] %></asp:LinkButton>  &nbs
</ItemTemplate></asp:Repeater></ItemTemplate></asp:Repeater
The outer repeater displays groups of data. Each group contains a series of linkbuttons which are also created by a repeater (the inner repeater). What I can't figure out is how to determine which linkbutton has been clicked. By setting the commandname of the linkbutton, I know which item in the inner repeater caused the event. But, I can't determine from which item in the outer repeater the event came from
I bound the following to the ItemCreated event of the outer repeater to capture events from the inner repeater
private void RepeaterOuter_ItemCreated(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e
Repeater links = e.Item.FindControl("RepeaterInner") as Repeater
links .ItemCommand += new RepeaterCommandEventHandler(this.RepeaterInner_ItemCommand)
Inside RepeaterInner_ItemCommand, I can succesfully interogate e.CommandName to find out which linkbutton was pressed. How do I determine which item in the outer repeater, though
One approach where I hit a dead-end was to embed additional information in the linkbutton tag to identify the outer repeater item. For instance, setting the CommandArgument with something that will identify the item of the outer repeater, except, I don't know how to access it. Is there a way to get at the Container.DataItem of the parent repeater from inside the nested repeater? Or is there a better approach to this
Thanks for any assistance!