Click here to Skip to main content
14,301,203 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi All,

I have a datagridview which sorts Data in ascending order on a datetime column,
Is there a way to display null date at the end of the grid(when Sorted Ascending).

Please help!!!

As the requirement is urgent.

Sibu Varghese.
Updated 28-Jan-12 22:48pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

try this one :

Dim sortedList = custList.
    OrderBy(Function(c) Not c.LastOrderDate.HasValue).
    ThenBy(Function(c) c.LastOrderDate)
DataGridView1.DataSource = sortedList.ToList()

Extracted from here :[^]

Also have a look at these pages :[^]

However this code is in C# but it worth conversion :[^]

Hope it helps.
sibu@varghese 29-Jan-12 23:41pm
But how to sort data which is datasource Bond using datatable
Amir Mahfoozi 29-Jan-12 23:51pm
This may help you :

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100