By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,506 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,506 IT Pros & Developers. It's quick & easy.

How sort DataView so blanks are at bottom, not top?

P: n/a
I have a DataTable with column "Sequence". Values are like:

Sequence
--------
5
1
3
(blank/null)
7
6
(blank/null)
4
When I create a DataView and do a sort, I get

Sequence
--------
(blank/null)
(blank/null)
1
2
3
4
5
6
7

But I need the blank/nulls to be at the end like

Sequence
--------
1
2
3
4
5
6
7
(blank/null)
(blank/null)
How can I do this, please?

Thanks,
Ron
Jul 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ronald,

You will have to add another column to the data (but might not be viewed
in the table) which will be included in the sort before the sequence number.
Something like "isNull". Then, sort on isNull descending, then sequence.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ronald S. Cook" <rc***@westinis.comwrote in message
news:OP**************@TK2MSFTNGP03.phx.gbl...
>I have a DataTable with column "Sequence". Values are like:

Sequence
--------
5
1
3
(blank/null)
7
6
(blank/null)
4
When I create a DataView and do a sort, I get

Sequence
--------
(blank/null)
(blank/null)
1
2
3
4
5
6
7

But I need the blank/nulls to be at the end like

Sequence
--------
1
2
3
4
5
6
7
(blank/null)
(blank/null)
How can I do this, please?

Thanks,
Ron

Jul 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.