Jeff
  • Jeff
  • Newbie Topic Starter
3 years ago
I am currently running your current winforms iGrid control in C#. The grid is unbound and is being loaded from data coming from a SQL database and loaded into a list of objects. Each object's fields are strongly typed based on how those values are stored in the database.

The issue is, I have a customer number, which is typed as an Integer. When I sort the customer number column, it is sorting as text not numeric. How do I set the column type when defining the layout of the grid? What sort technique should I be using to ensure numbers are actually sorted as numbers?

Thank you for your help
Jeff
  • Jeff
  • Newbie Topic Starter
3 years ago
I found the issue and the sort is now working correctly. I had incorrectly set the iGSortType setting.
Igor/10Tec
3 years ago
It's hard to say what is wrong without seeing the whole application and source code, but most likely, your customer numbers come as strings to iGrid. If they were integers, you would not need to think about special sorting tricks at all. Check the type of customer numbers in iGrid.
mpspark
3 years ago
I'm having the same problem. It should be super easy but I'm puzzled.

My data comes straight from the database pre-formatted like '6,123,346'. The problem is that when the user clicks the column header iGrid thinks they are strings and sorts accordingly. How do I change it so it recognizes the values as numbers?

Actually, I'm using ActiveX (v3)

Thanks.
Igor/10Tec
3 years ago
Use the CustomSort event to provide your own comparison algorithm.
mpspark
3 years ago
I figured it out. Thanks.