asp.net - please help me in creating a sort expressions for datatable in vb.net -
I have found a statistic that has several columns with three main ones:
- hotelid
- Hotel names
Some hotels have only dshotelid, some are only picky and some have both datholide and hive.
I should sort out so that the hotels should be topped for both the Doshotid and Hotel hotel and then those hotels will get only Dashotid and for the hotels that are near the hotel only. ...
> Please help me make such an expression.I made it:
dtmaintable.DefaultView.Sort = "dshotelid, hotelid"
but it does not make me the desired output Is giving up.
at the top of the sorted column (unless sort order is in descending order) Maybe looking at the rows below with hotel hotels and dashotids, instead of p?
How is this data table populated? If it is coming from a database query, it is a simple matter to create an additional column (or column) that has the sorting of your needs - this is a mix of other columns or some other unique identifier.
Edit: February 4, 2010 - In response to your 'Filter and Certified' solution:
Your solution works, but this filter and Not because of the sortable label - this is because you used a different type of command.
By default, you use "dsohtelid, hotelid"
For the second time, you have "dshotelid desc , hotelid desc ".
It will not use your non-top in top and tap, but I will dispute that it will pass as a good solution. Your ID is now backwards sort - just like the way I think you I want to avoid, so suggestions from my new sort column would be respected.
However, if the ID does not make sense, then your solution is fine and you can stay with the addition of 'desc' with your original code, such as:
Dtmaintable.DefaultView.Sort = "dshotelid desc, hotelid desc"
Of course, if I said anything that any kind of use has been done for you, then tick is appreciated Will go. This will help me reach 50 representative points and will eventually be able to write a comment. :)
Comments
Post a Comment