How do I freeze a column from scrolling with the rest of the data. I want to display a grid with the last columns always visible. The rest of the data must scroll left or right without the last columns moving.
Thank you
I don't understand what you mean. The frozen columns have to be moved over to the left, so the column order will change. There's no way around that.
If you mean the order of the columns within the fixed and unfix section, you can control the order of the columns by setting the column.Header.VisiblePosition property. It's a good idea to set these in order from 0 up to avoid having the setting on one column affect any other columns.
I also did the same in the initializelayout. The first 5 columns are freezed. But when i change my data source the columns order also changes. If i comment out the freeze column code, it works perfectly fine. Any idea?
thanks
You can do this with Fixed headers. Set UseFixedHeaders to true and then set the Fixed property on the column header(s) you want to fix. I would do all of this in the InitializeLayout event of the grid.