Click to See Complete Forum and Search --> : [RESOLVED] VB.Net 2008 Sort DataGridViewTextBoxColumn Numeric values


remya1000
01-27-2012, 08:03 AM
I’m using VB.Net 2008 application program.

I’m using DataGridView, where column types DataGridViewTextBoxColumn. I have 3 fields. 1 field values are numeric, 1 field values are string and 1 field values are decimal.

When I try to sort the string value column, it sorts correctly. But when i try to sort the numeric value column, it sorts as if its string value.

I searched a lot to make it sort numerically. But I couldn’t find it.

If you know how i can sort that column, please help me. If you can provide an example, that will be so helpful.

Thanks in advance.

ssystems
01-27-2012, 09:54 AM
DataGridViewTextBoxColumn will make it a string hence you need to convert it to numeric. You may also need to implement your own comparator depending on how you're sorting the data

remya1000
01-29-2012, 07:00 AM
Thanks for your help. it's working.

As you mentioned while adding data to column, somehow i converted that to string. once i removed that, it's working fine and start sorting.

Thanks a lot for your help...