John Beeman

John Beeman

  • NA
  • 15
  • 0

Sort a datagrid column by ascending numerical order?

Aug 11 2008 4:06 PM
I am having trouble figuring out how to sort a datagridview using the code below. The column has integer values (anywhere from about 1-100). It appears that the problem is it sorts on the first digit (e.g., 7 sorts below 19 because 7 is greater than 1) instead of the entire number. Does anyone know a way around this issue?

dataGridView1.Sort(dataGridView1.Columns[0], ListSortDirection.Ascending);

Answers (1)