473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
1 4688
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Raymond Lewallen | last post by:
I have a dataview in which the sort property will not sort the dataview. Here's is a simple scenario similar to what I am doing: Class Foo Private Function Retrieve() As DataView ' Returns a...
2
by: Peter S. Guild | last post by:
Hello, I have a simple routine that uses a dataview to hold information. I need to sort these columns by section and then by desc. No matter what I do the dataview will not sort. What am I...
7
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private...
1
by: troyblakely | last post by:
I am having trouble sorting a datagrid. I have read numerous posts on this and other lists, and tried most of the suggestions, but none of them have worked for me yet. I populate a dataset from two...
4
by: G .Net | last post by:
Hi I have a question which I hope you can help with. I am setting the DataSource of a DataGrid to be a DataView. I am sorting the DataView by various fields which include a Date. When I...
3
by: Thirsty Traveler | last post by:
I have a gridview where the datasource is bound after a selection. The result of doing this is that sorting and paging do not work. I was given a sample of how to resolve this, however my attempt...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.