Hi,
I have a gridDataBoundGrid wired to a gridFilterBar. To ensure that the comboboxes on the filterbar are sorted when clicked on, I have the following code:
for(int i = 0; i < grid.Model.ColCount; i++)
{
DataTable dt = grid[1, i].DataSource as DataTable;
if(dt != null)
{
string sortString = dt.Columns[0].ColumnName + " ASC";
dt.DefaultView.Sort = sortString;
}
}
The reason I need this code is because as rows are being added/deleted from the grid I update the filterbar combobox models are described in:
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=19224
This works fine as long as the DataType for the columns these comboboxes are being used on are strings. I have some columns that are ints but when the values are added to the combobox model they are being added as strings and then the combo box is not sorted numerically. I can''t change the dataType as the (none) value needs to be displayed. Is there anyway I can get the combobox to sort numerically?
Regards,
Matt