How to sort numbers from lowest to highest in my datagrid table?
Printable View
How to sort numbers from lowest to highest in my datagrid table?
by the way:Code:DataGridView1.Sort(DataGridView1.Columns(0), System.ComponentModel.ListSortDirection.Ascending)
First of all, your grid should have a datatsource (which could even be a List Of integers, for example)
and you should mainly add, remove or sort the underlying datasource.
It's not working because if I enter number "35" and then "99" and then "353".They are sorted by:
35
353
99
why??
99 is less than 353.
oppssss. That is because it looks at it as strings. you should implement a comparer