How can I lock a column for a long data grid ?
I'd like to lock the column to avoid scroll action in it.
I have a row with an 'Hotel' column and a lot of 'Date' columns, and I'd like to scroll along date columns and lock 'Hotel' column.
How can do it?
Thank you Matt.
This is what I want.
I think that 'filters' work similary, I try to do the same. Only filter some columns.
I try it and I will write here if I can't .
Thanks.
The updated code would look like:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e){ e.Layout.UseFixedHeaders = true; e.Layout.Override.FixedHeaderIndicator = Infragistics.Win.UltraWinGrid.FixedHeaderIndicator.None; e.Layout.Bands[0].Columns["Hotel"].Header.Fixed = true; }
Note that you could also set the FixedHeaderIndicator on the column itself should you want to show it to the user, or you can do so for other columns if you wish. This code will not show any fixed header indicators, though the "Hotel" column will be fixed.
-Matt
Thanks Matt.
It works well, but I don't want that other's columns may set fixed too.
With this options every column can be set to fixed column and be moved behind others fixed columns.
In my scenario is a fatal error because columns are ordered by date.
How can evoid that users can fixed others columns ?
Note: Sorry for my english :)
You would set the Fixed property on the column's header, after also making sure that you've turned on fixed headers for the grid.
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e){ e.Layout.UseFixedHeaders = true; e.Layout.Bands[0].Columns["Hotel"].Header.Fixed = true;}