Results 1 to 4 of 4

Thread: Group a datalist?

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Group a datalist?

    Hi all,

    I have a datalist which displays the following data from a SQL DB in descending order by date (see example of how data looks in datalist):
    Code:
    Event Name: Event1
    Event Location: 123 Main Street, Milwaukee, WI 58745
    Date: 3/17/2009
    Time: 5:00 PM - 7:00 PM
    
    Event Name: Event2
    Event Location: 456 Main Street, Milwaukee, WI 57674
    Date: 2/15/2009
    Time: 5:00 PM - 7:00 PM
    
    Event Name: Event3
    Event Location: 789 Main Street, Milwaukee, WI 58746
    Date: 2/05/2009
    Time: 5:00 PM - 7:00 PM
    
    Event Name: Event4
    Event Location: 789 Main Street, Milwaukee, WI 58746
    Date: 1/06/2009
    Time: 5:00 PM - 7:00 PM
    Note: These fields are in the item template

    This works great except that I'd like to somehow group them by month so it looks something like:

    Code:
    March 2009
    Event Name: Event1
    Event Location: 123 Main Street, Milwaukee, WI 58745
    Date: 3/17/2009
    Time: 5:00 PM - 7:00 PM
    
    February 2009
    Event Name: Event2
    Event Location: 456 Main Street, Milwaukee, WI 57674
    Date: 2/15/2009
    Time: 5:00 PM - 7:00 PM
    
    Event Name: Event3
    Event Location: 789 Main Street, Milwaukee, WI 58746
    Date: 2/05/2009
    Time: 5:00 PM - 7:00 PM
    
    January 2009
    Event Name: Event4
    Event Location: 789 Main Street, Milwaukee, WI 58746
    Date: 1/06/2009
    Time: 5:00 PM - 7:00 PM
    If I throw another label in there with the month information, it will display of course, but it will display for every record. I'd like it to only show once per month. Is there some way I can accomplish this? I'm using VS 2008 and ASP.NET 2.0

    Thanks,

    Strick
    Last edited by stricknyn; Dec 15th, 2008 at 01:46 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width