Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting a datagrid
Message
 
 
To
13/05/2004 11:43:00
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00903637
Message ID:
00903675
Views:
12
Hi Bonnie

I have tried your suggestion, it didn't crash but it didn't sort the column correctly either.

I have also tried.

this.AnimalsDt.DefaultView.Sort = "EarTag.Substr(1,8).Trim(), EarTag.Substr(EarTag.length-5).Trim()";

this.AnimalsDt.DefaultView.Sort = "OT.Substr(1,8) + OT.Substr(OT.length-5)";

Theses didn’t work either.

The data in the column varies in length.

Do you have any other ideas on sorting the column?

Thanks.

John





>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
Previous
Reply
Map
View

Click here to load this message in the networking platform