Winform DatagridView Numeric Column Sorting

前端 未结 6 1997
有刺的猬
有刺的猬 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 06:21

    It is sorting it by character. You need to make the column type float so it knows what comparison operator to apply.

    (That is you need to make the column type in your dataset float, I believe that will work.)

提交回复
热议问题