0

I have data prepared and sorted in order that I need to display on the grid. I am passing this data to my BindingSource.DataSource. When I am checking what's inside it, then I can see all data in proper order. But they are displayed on the grid sorted differently.

I don't sort them anywhere in the code (after passing the data to my BindingSource). I assume that is DevExpress (v2010.1) default behavior, but how to disable/handle this? I just need the data to be displayed exactly in the order they were passed.

I was trying to find some setting inside the Designer, but I found only how to disable sorting for the user. I was also trying to disable sorting in the code:

grid.BeginDataUpdate();
grid.ClearSorting();
grid.OptionsCustomization.AllowSort = false;
grid.Columns[FirstColumn].SortOrder = ColumnSortOrder.None;
grid.Columns[FirstColumn].OptionsColumn.AllowSort = DefaultBoolean.False;
grid.Columns[SecondColumn].SortOrder = ColumnSortOrder.None;
grid.Columns[SecondColumn].OptionsColumn.AllowSort =DefaultBoolean.False;
grid.EndDataUpdate();
futerk0
  • 1
  • 4

1 Answers1

0

Workaround: create another column in the table, to store integer values. Make it non-visible. Sort the data by this column.

futerk0
  • 1
  • 4