Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting a datagrid
Message
From
13/05/2004 11:43:00
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00903637
Message ID:
00903654
Views:
15
Well, John, I know you can do this:
this.AnimalsDt.DefaultView.Sort = "EarTag, AnotherColumn, Etc" ;
but, whether or not you can do this;
this.AnimalsDt.DefaultView.Sort = "EarTag.Substr(1,8), Eartag.Substr(Eartag.length-5)";
I'm not sure. Try it and see if it works.

~~Bonnie

>I need to sort a datatable / view on an expression.
>
>In VFP you can use INDEX ON LEFT(ALLTRIM(Eartag),8)+RIGHT(ALLTRIM(Eartag),5)
>
>I can sort the column using the following code.
>
>
>this.AnimalsDt.DefaultView.Sort = "EarTag ASC" ;
>
>
>How sort it using an expression using C#.
>
>Thanks
>
>John
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform