This is a discussion on How to sort object array? within the C# Programming forums, part of the Software Development category; I have created a class called "Books". Books[] bk = new Books[2]; bk[0] = new Books(); bk.Name = &...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| I have created a class called "Books". Books[] bk = new Books[2]; bk[0] = new Books(); bk.Name = "Test"; bk[1] = new Books(); bk.Name = "Abs"; how to sort the object array bk? Thanks in advance.
__________________ Raja. Myblog |
| Sponsored Links |
| |||
| you can use the Array.Sort(Array, Array) function to Sort Arrays |
| |||
| oh...so implementation the IComparer interface....and add methods |
| |||
| string[] files = System.IO.Directory.GetFiles(); NumericComparer ns = new NumericComparer(); Array.Sort(files, ns); string[] dirs = System.IO.Directory.GetDirectories(); ns = new NumericComparer(); Array.Sort(dirs, ns); |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to sort Datatable | oxygen | C# Programming | 2 | 04-22-2008 10:25 PM |
| Dif..sort();asort();ksort() | Arun | Flash Actionscript Programming | 1 | 09-07-2007 08:14 AM |
| What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ? | Archer | C# Programming | 2 | 08-25-2007 03:00 AM |
| Object reference not set to an instance of an object for crystal reports in .net | KiruthikaSambandam | Database Support | 1 | 08-03-2007 03:26 AM |
| How can you sort the elements of the array in descending order In C#. NET 2005? | Archer | C# Programming | 1 | 07-24-2007 12:33 AM |