Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Fields with NULL in them tend to appear at the top of sorted columns (unless the sort is in descending order) so you're probably seeing rows with both hotelid and dshotelid at the bottom, instead of the top?</p> <p>How is this data table populated? If it's coming from a database query, it's a simple matter to construct an additional column (or columns) which contain(s) whatever sort key you need - be it an amalgum of other columns or some other unique identifier.</p> <p><strong>EDIT: Feb 4, 2010 - in response to your 'FilterAndSortTable' solution:</strong></p> <p>Your solution works but it's not because of the FilterAndSortTable - it's because you used a different sort order.</p> <p>Originally, you used "dsohtelid, hotelid". </p> <p>The second time, you used "dshotelid <strong>desc</strong>, hotelid <strong>desc</strong>".</p> <p>This has the effect of putting your non-nulls at the top and nulls at the bottom, but I would dispute that this qualifies as a good solution. Your id's are now sorted backwards - which I kind of assumed you might want to avoid, hence my suggestion of a new sort column that would respect this.</p> <p>Still, if the order of id's doesn't matter then your solution is fine and you can simply stick with your original code, with the addition of 'desc', like so:</p> <pre><code>dtmaintable.DefaultView.Sort = "dshotelid desc, hotelid desc" </code></pre> <p>Of course, if anything I've said here has been of any use to you, a tick would be muchly appreciated. It would help me reach 50 rep points and finally be able to write comments. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload