Sorting in datagridview

KNN

Member
Joined
Oct 6, 2006
Messages
14
Programming Experience
1-3
I'm trying to figure out how to sort data in datagridview in reverse order. Data is unbound, it is entered in bunch of text boxes and then passed to datagridview. I need the latest entry to be on top(first) , not on bottom like the default is. ps. I only have one column, so every new entry is a new row.
 
If the items are not already sorted you can't "sort in reverse" without disturbing the order. What you have to do is to insert new as first item instead of appending as last item, ie. use DGV.Rows.Insert method instead of DGV.Rows.Add method.
 
Back
Top