sorting a table

Hello, I have 1 question : Can I sort a table without to give a letter. In in sample I have to give the letter "B", but I want sort from A to Z or from 1... to 9...? How I have to take the add-function? regards A.M. (Berlin)

3 Replies

AD Administrator Syncfusion Team April 12, 2005 12:49 PM UTC

Hi Andreas, Are you referring to the AlphabeticalPaging sample in the ASP.NET version of Essential Grid? In that sample you can sort by: this.GridGroupingControl1.TableDescriptor.SortedColumns.Add("ContactName"); or this.GridGroupingControl1.TableDescriptor.SortedColumns.Add("ContactName", System.ComponentModel.ListSortDirection.Ascending); Regards Arun


AM Andreas Moeller April 13, 2005 06:29 AM UTC

Hi Mr. Arun, I tried the sample from VB.Net Essential Grid and I don''t want to give a Contactname like the sample. In this sample I get some B-Values (B3,B7,B13,B2) and after the sorting I get the new order B2,B3,B7,B13. Now I want to give not the Contactname "B", I want sort the values like B5,A7,V3,D9 to A7,B5,D9,V3 (from A to Z) or numbers like 34,23,78,44 to 23,34,44,78. Is it possible? How I have to descripe the contactname? P.S. I want to combine this module with the ExcelRW-module to show the values and for save in a xls-format. I think that should be possible. Regards Andreas >Hi Andreas, > >Are you referring to the AlphabeticalPaging sample in the ASP.NET version of Essential Grid? > >In that sample you can sort by: > >this.GridGroupingControl1.TableDescriptor.SortedColumns.Add("ContactName"); > >or > >this.GridGroupingControl1.TableDescriptor.SortedColumns.Add("ContactName", System.ComponentModel.ListSortDirection.Ascending); > >Regards >Arun >


AD Administrator Syncfusion Team April 14, 2005 07:11 PM UTC

Hi Andreas, the sorting in the WebGrid works the same as found in the GridGroupingControl for Windows Forms. You can specify a custom comparer for the column you sort by. Is that something you want to do? See the following KB for a custom Comparer http://www.syncfusion.com/Support/article.aspx?id=10507 The same logic can be applied to a web grid. But let me know if I misunserstood your requirements. Thanks, Stefan >Hi Mr. Arun, > >I tried the sample from VB.Net Essential Grid and I don''t want to give a Contactname like the sample. In this sample I get some B-Values (B3,B7,B13,B2) and after the sorting I get the new order B2,B3,B7,B13. Now I want to give not the Contactname "B", I want sort the values like B5,A7,V3,D9 to A7,B5,D9,V3 (from A to Z) or numbers like 34,23,78,44 to 23,34,44,78. Is it possible? How I have to descripe the contactname? > >P.S. I want to combine this module with the ExcelRW-module to show the values and for save in a xls-format. I think that should be possible. > >Regards >Andreas > >>Hi Andreas, >> >>Are you referring to the AlphabeticalPaging sample in the ASP.NET version of Essential Grid? >> >>In that sample you can sort by: >> >>this.GridGroupingControl1.TableDescriptor.SortedColumns.Add("ContactName"); >> >>or >> >>this.GridGroupingControl1.TableDescriptor.SortedColumns.Add("ContactName", System.ComponentModel.ListSortDirection.Ascending); >> >>Regards >>Arun >>

Loader.
Up arrow icon