Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Outlook "like" Date Groupings

Outlook "like" Date Groupings

Scheduled Pinned Locked Moved C#
tutorialcsharpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pgraeve
    wrote on last edited by
    #1

    I am just looking a good C# example of grouping a list of data by "Date Groups" like Microsoft does in Outlook 2003 Inbox where e-mail is grouped by "date terms" like "Today", "Yesterday", "Tomorrow", "Two Weeks Ago" etc... I started embarking on this code myself but it got complicated quickly so I thought someone smarter than me must have already tackled this one and posted a good article on how to do it somewhere - anyone know of one??? Thanks in advance!!!

    W 1 Reply Last reply
    0
    • P pgraeve

      I am just looking a good C# example of grouping a list of data by "Date Groups" like Microsoft does in Outlook 2003 Inbox where e-mail is grouped by "date terms" like "Today", "Yesterday", "Tomorrow", "Two Weeks Ago" etc... I started embarking on this code myself but it got complicated quickly so I thought someone smarter than me must have already tackled this one and posted a good article on how to do it somewhere - anyone know of one??? Thanks in advance!!!

      W Offline
      W Offline
      Werdna
      wrote on last edited by
      #2

      If you're willing to wait for .net 2 then ListView has grouping ability in there.

      P 1 Reply Last reply
      0
      • W Werdna

        If you're willing to wait for .net 2 then ListView has grouping ability in there.

        P Offline
        P Offline
        pgraeve
        wrote on last edited by
        #3

        Actually doing the "groups" in the ListView is not a problem (I am using Infragistics Grid Control and grouping by dates is easy…) but what I need is the function which accepts in a date, and returns a string for "Yesterday", "Tomorrow", "Last Month", etc... I know it sounds easy, but it gets pretty complicated quickly to do it right and take into account all the possibilities. For example, on the first day of the month, if you send the function yesterday’s date, the function needs to return "Yesterday" not last month. Same thing for first day of the year etc… Anyway, whenever I run into something even slightly complicated, I always figure someone smarter than me has already written some very elegant and efficient code to handle it! MS has this code for Outlook, just wondered if anyone had replicated it in a good C# example.

        G 1 Reply Last reply
        0
        • P pgraeve

          Actually doing the "groups" in the ListView is not a problem (I am using Infragistics Grid Control and grouping by dates is easy…) but what I need is the function which accepts in a date, and returns a string for "Yesterday", "Tomorrow", "Last Month", etc... I know it sounds easy, but it gets pretty complicated quickly to do it right and take into account all the possibilities. For example, on the first day of the month, if you send the function yesterday’s date, the function needs to return "Yesterday" not last month. Same thing for first day of the year etc… Anyway, whenever I run into something even slightly complicated, I always figure someone smarter than me has already written some very elegant and efficient code to handle it! MS has this code for Outlook, just wondered if anyone had replicated it in a good C# example.

          G Offline
          G Offline
          Gary Thom
          wrote on last edited by
          #4

          You could probably adapt http://www.codeproject.com/cs/miscctrl/GroupListView.asp#xx824943xx Gary "I invented the internet". - Al Gore, former U.S. Vice President

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups