Sorting problem.
-
Hi.. My data (before sorting) is like the following. Fig 8 3.5-2 3.4.1-1 Appendix A ------------------ After sorting, it should be 3.4.1-1 3.5-2 Appendix A Fig 8 i m using VS2005, C#.NET and ASP.NET 2.0 Is there anyone to guide me how to sort? thanks in advance! :)
-
Hi.. My data (before sorting) is like the following. Fig 8 3.5-2 3.4.1-1 Appendix A ------------------ After sorting, it should be 3.4.1-1 3.5-2 Appendix A Fig 8 i m using VS2005, C#.NET and ASP.NET 2.0 Is there anyone to guide me how to sort? thanks in advance! :)
If you don't mind cheating, you can do the following: - Create a comboBox, or some other such control, with neither dimensions nor visibility - you need some sort of container for your data, anyway. - Set the sort property to true. - Add() your items. - Read them back, when you need them, by their index. - an added bonus to this method is that it will stay sorted if you add more members, but by the same token, indices will change. That caution will be true, however, for any sort method. If you ever upgrade to VS2008, you can use LINQ.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"How do you find out if you're unwanted if everyone you try to ask tells you to stop bothering them and just go away?" - Balboos HaGadol"It's a sad state of affairs, indeed, when you start reading my tag lines for some sort of enlightenment?" - Balboos HaGadol
-
If you don't mind cheating, you can do the following: - Create a comboBox, or some other such control, with neither dimensions nor visibility - you need some sort of container for your data, anyway. - Set the sort property to true. - Add() your items. - Read them back, when you need them, by their index. - an added bonus to this method is that it will stay sorted if you add more members, but by the same token, indices will change. That caution will be true, however, for any sort method. If you ever upgrade to VS2008, you can use LINQ.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"How do you find out if you're unwanted if everyone you try to ask tells you to stop bothering them and just go away?" - Balboos HaGadol"It's a sad state of affairs, indeed, when you start reading my tag lines for some sort of enlightenment?" - Balboos HaGadol
-
Thanks for your suggestion. i need to sort the whole datatable based on this field(locator 1)and next one field(locator 2). the datatable has altogether 8 columns. next field is only number. anyway, thank you very much. :)
No Problem - But a word of advice: You may wish to make your data structure (and source?) information part of your question in the future. As you originally wrote it, it seemed like a simple sort of some data strings. Another thought: since this is a general discussion, you may wish to note the language you're using. My suggestion was language-neutral. A place you can go (without cheaping out on the effort or using LINQ in VS2008) is to check out the STL (which MS actually made usable in VS2005) - at least if you're using C++.
-
No Problem - But a word of advice: You may wish to make your data structure (and source?) information part of your question in the future. As you originally wrote it, it seemed like a simple sort of some data strings. Another thought: since this is a general discussion, you may wish to note the language you're using. My suggestion was language-neutral. A place you can go (without cheaping out on the effort or using LINQ in VS2008) is to check out the STL (which MS actually made usable in VS2005) - at least if you're using C++.