We help IT Professionals succeed at work.
Get Started

Help with nested repeater and parameters

cdemott33
cdemott33 asked
on
576 Views
Last Modified: 2012-05-11
I have a repeater called "myimages" that displays the name of an image and the image itself.  I need to nest another repeater (called myimagedetails) with the myimages repeater.  The myimagedetails contains a Grid.  

Is there a way to use a FUNCTION for my datasource of the nested myimagedetails repeater so I can pass a parameter?

The initial repeater has a value called "ImageID" that I'd like to pass via my fucntion.  The function would return a datatable based on the ImageID parameter and would load the Grid wtih the proper information.

Is this possible?  If so, could you provide me with an example of how I could achieve this?

Thanks!

Example below is as far as I've gotten.
<asp:Repeater ID="myimages" runat="server">
            <ItemTemplate>
               <table class="style1">
                <tr>
                    <td>
                        Image Name: <%# DataBinder.Eval(Container.DataItem, "name")%>
                        Picture:
                        <img alt="Picture" src="<%# DataBinder.Eval(Container.DataItem, "ImageURL")%>"  />
                    </td>
                    <td>
                        <asp:Repeater ID="myimagedetails" runat="server" DataBind=????????????????>
                            <ItemTemplate>
                                <asp:GridView ID="GridItemDetails" runat="server">
                                </asp:GridView>
                            </ItemTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
            </table>           
            </ItemTemplate>
        </asp:Repeater>

Open in new window

Comment
Watch Question
Consultant Software Engineer - .NET Architect
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE