SortedBindingList - advanced sort

SortedBindingList - advanced sort

Old forum URL: forums.lhotka.net/forums/t/6304.aspx


dejan.caric posted on Saturday, January 31, 2009

I have a small problem.
I have Invoice class with Invoice number property. It's in nnn/yy format.
NNN - represents starting number
YY - represents the year invoice was created.

Now I want to sort Invoices by year, and than by number:
31/08
32/08
20/09

Thanks for help

sergeyb replied on Saturday, January 31, 2009

You can just create a computed property that returns a string in correct format to allow you sort properly, then sort on that property instead of real invoice number.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: dejan.caric [mailto:cslanet@lhotka.net]
Sent: Saturday, January 31, 2009 10:27 AM
To: Sergey Barskiy
Subject: [CSLA .NET] SortedBindingList - advanced sort

 

I have a small problem.
I have Invoice class with Invoice number property. It's in nnn/yy format.
NNN - represents starting number
YY - represents the year invoice was created.

Now I want to sort Invoices by year, and than by number:
31/08
32/08
20/09

Thanks for help


Copyright (c) Marimer LLC