how to sort datagridview ? (a numeric field)
-
hi all, i want to sort my datagridview but i am not able to do it so far. :( predefined Sort function does the sorting for string values. for example: let's say i have 1,8,5,4,10 in cell[0] after sorting i get: 1,10,4,5,8 but i want: 1,4,5,8,10 is there anyone knows how to sort a numeric column in datagridview ? thanks in advance...
MFA
-
hi all, i want to sort my datagridview but i am not able to do it so far. :( predefined Sort function does the sorting for string values. for example: let's say i have 1,8,5,4,10 in cell[0] after sorting i get: 1,10,4,5,8 but i want: 1,4,5,8,10 is there anyone knows how to sort a numeric column in datagridview ? thanks in advance...
MFA
-
hi all, i want to sort my datagridview but i am not able to do it so far. :( predefined Sort function does the sorting for string values. for example: let's say i have 1,8,5,4,10 in cell[0] after sorting i get: 1,10,4,5,8 but i want: 1,4,5,8,10 is there anyone knows how to sort a numeric column in datagridview ? thanks in advance...
MFA
Hi, sorting a DataGridView is no different than sorting any other collection: - they have a Sort() method that applies a default sort order - they have a Sort(IComparer) method that takes an object capable of comparing two objects of the type you want to get sorted. So read up on IComparer, and provide a little class that inherits from it. The world must be full of examples of this. :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
Hi, sorting a DataGridView is no different than sorting any other collection: - they have a Sort() method that applies a default sort order - they have a Sort(IComparer) method that takes an object capable of comparing two objects of the type you want to get sorted. So read up on IComparer, and provide a little class that inherits from it. The world must be full of examples of this. :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }