Hello,
I'm currently putting results of a Web Service call, into an ArrayList and binding successfully (columns auto generated). During binding I hide certain columns and the next step is to start formatting. I've looked through numerous articles on using OnColumnCreated/Creating, PreRender, and whatever I do to change the DataFormatString and DataType doesn't work when sorting. I'm trying to format the Amount column as System.Decimal, format as currency and sort but it is still sorting as a string (the native type in ArrayList).
EDIT: Over the course of a day I've done better troubleshooting and found that I expected the grid to convert values to the specific DataType. In my case, all JSON deserialized types were System.String. I now convert from IList to DataTable and change the DataType of the Amount column before populated. This works and sorts correctly now. Hope that helps someone.
I'm currently putting results of a Web Service call, into an ArrayList and binding successfully (columns auto generated). During binding I hide certain columns and the next step is to start formatting. I've looked through numerous articles on using OnColumnCreated/Creating, PreRender, and whatever I do to change the DataFormatString and DataType doesn't work when sorting. I'm trying to format the Amount column as System.Decimal, format as currency and sort but it is still sorting as a string (the native type in ArrayList).
EDIT: Over the course of a day I've done better troubleshooting and found that I expected the grid to convert values to the specific DataType. In my case, all JSON deserialized types were System.String. I now convert from IList to DataTable and change the DataType of the Amount column before populated. This works and sorts correctly now. Hope that helps someone.