Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6671605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:24:29+00:00 2026-05-26T03:24:29+00:00

I have a list of objects in C# I’m trying to bind to a

  • 0

I have a list of objects in C# I’m trying to bind to a Repeater. Here is a simplified example of my class:

public class LineDetail
{
    public int ClassID { get; set; }
    public IPerson Teacher { get; set; }
    public IList<IPerson> Students { get; set; }
    public string ClassTitle { get; set; }
    public DateTime StartTime { get; set; }
    public DateTime EndTime { get; set; }
}

The part that has be confused is the Students property. Of course, I bind my List to the repeater:

LineItems.Sort((x, y) => DateTime.Compare(x.StartTime, y.StartTime));
ResultsPanel.Visible = true;
Schedule.DataSource = Meetings;
Schedule.DataBind();

And I declare my repeater:

<asp:Repeater ID="Schedule" runat="server">
    <HeaderTemplate>
        <table width="650" border="1" bordercolor="#222222">
            <tr>
                <td> Time </td>
                <td> Teacher </td>
                <td> Class Title </td>
                <td> Students </td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
            <td>
                <%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "StartTime")).ToString("h:mm")%>
                -
                <%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "EndTime")).ToString("h:mm")%>
            </td>
            <td> <%# DataBinder.Eval(Container.DataItem, "Teacher").ToString() %> </td>
            <td> <%# DataBinder.Eval(Container.DataItem, "ClassTitle")%> </td>
            <td> <%# DataBinder.Eval(Container.DataItem, "Students")%> </td>
        </tr>
    </ItemTemplate>
    <FooterTemplate></table></FooterTemplate>
</asp:Repeater>

But I don’t know how (or if its even possible) to output the List Students property. I tried a nested repeater, but that didn’t work. I don’t believe it was syntax related since it compiled.

My inner repeater was:

<td> 
    <asp:Repeater id="ParliamentarianRepeater" runat="server">
        <HeaderTemplate><ul></HeaderTemplate>
        <ItemTemplate>
            <li>
                <%# DataBinder.Eval(Container.DataItem, "Students.Firstname") %>
            </li>
        </ItemTemplate>
        <FooterTemplate></ul></FooterTemplate>
    </asp:Repeater>
</td>

I don’t know how to accomplish what I need to do.

Can you please point me in the right direction? I’m open to other ways in which this data could be displayed nicely as well. Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:24:30+00:00Added an answer on May 26, 2026 at 3:24 am

    You have to set the DataSource for the Inner Repeater

    Your inner repeater code should look like this

    <td><asp:Repeater id="ParliamentarianRepeater" runat="server" DataSource='<%# DataBinder.Eval(Container.DataItem, "Students")%>'>
    <HeaderTemplate><ul></HeaderTemplate>
    <FooterTemplate></ul></FooterTemplate>
    <ItemTemplate>
    <li>
    <%# DataBinder.Eval(Container.DataItem, "Firstname") %>
    </li>
    </ItemTemplate>
    </asp:Repeater>
    </td>
    

    The inner repeater must be inside the “ItemTemplate” tag from your parent Repeater.

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of objects (Debtors) in this structure public class DebtorDto {
I have 2 List objects: List<int> lst1 = new List<int>(); List<int> lst2 = new
I have List where myObj has it own list of objects called example mySubObj.
I have a list of objects (for the sake of example, let's say 5).
I have a list of objects that have two int properties. The list is
You have list of objects and each of them has an id property. Here's
I have a list of objects similar to the one below ( MyData class)
I have a list objects I use to fill using Petapoco. The class properties
I have list of objects type Node ( items ). And Node class has
I have a list of objects of the same class. The order of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.