I have a problem with sorting in Infragistics column.
I have a column with numbers (long type), but the column data type is a string.
So now it sorts by a string which is not valid. If I change column data type to typeof(long), the sorting stopped working.
Do you know how can I change sorting type for numeric values?
Updated:
myCell.Column.DataType = typeof(string);
I'm using Infragistics4.Win.v12.2
You can't change the DataType property of the Column if it is a column bounded to a DataSource. Instead you can create a new column in the datasource with an expression initializer that allows you to convert the String column in a long column. Then in the grid you can hide the string column and let your user see only the column created with an expression.
Suppose you have a DataTable loaded in this way
Now you can add a new column of long type using an Expression that copies the content of the String column (I assume that every single row is convertible to long)
Finally in the InitializeLayout event handler of the grid hide the string column and position the long column in its place