Winform DatagridView Numeric Column Sorting

前端 未结 6 1879
有刺的猬
有刺的猬 2021-02-06 05:26

I am using just a simple DataGridView to hold a bunch of data (Funny that).

I have decimals in a particular column. But when it comes to ordering by that decimal column

6条回答
  •  别跟我提以往
    2021-02-06 05:54

    Your problem is the datagridview is sorting by string. Try casting the string to float when you copy that cell into the datagrid.

提交回复
热议问题