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 4592302
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:31:10+00:00 2026-05-21T22:31:10+00:00

I have a List<Event> and an Event has a Date property. I’m currently binding

  • 0

I have a List<Event> and an Event has a Date property. I’m currently binding this list to an asp:repeater which is fine and results in a list of event titles like this:

event 1
event 2
event 3
event 4
event 5

However, now I wish to add some kind of separator to my list between events occurring on different days so that my list looks like:

Tuesday, May 10, 2011
event 1
event 2
Wednesday, May 11, 2011
event 3
Thursday, May 12, 2011
event 4
event 5

Can anyone recommend a good way to do this. I’m happy to manipulate my list server-side or to bind my list and then add the separators client-side with jQuery. Any suggestions?

  • 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-21T22:31:11+00:00Added an answer on May 21, 2026 at 10:31 pm

    You can group by date server side using Linq’s GroupBy

    class Event
    {
        public DateTime EventDate;
        public string EventName;
    }
    
    List<Event> events = GetEvents();
    
    var grouped = events.GroupBy(e => e.EventDate.Date).OrderBy(g => g.Key);
    
    foreach (var grouping in grouped)
    {
        Console.WriteLine(grouping.Key); // <-- this is the date
    
        foreach (Event e in grouping) // <-- this is the list of events
        {
            Console.WriteLine(e.EventName); 
        }
    }
    

    GroupBy returns IEnumerable<IGrouping<TKey, TSource>>, so in this case you are returning IEnumerable<IGrouping<DateTime, Event>>

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

Sidebar

Related Questions

I have a List<T> where T is my Event type which has a field
I have a List (Of MyObject) binding to a GridView in the Page_Load event.
I have a dropdown list. I am using onchange event of this dropdown to
I have a table that shows a list of events, each event also has
I have a Django model called Event that has a date field for the
i have a list of event Ids that i want to be excluded from
I have a list of dates for an event in the following format 13/04/2010
I have a Result object that lets me pass around a List of event
I have a s:List component. I want to handle a click event to know
I have an event handler that will remove an element from a list of

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.