Call me stupid but I can't seem to track down the property to disable column sorting. I dont want users to be able to use this feature.
A hint please?
Many thanksJason
UltraGrid provide 2 mode when click Header: Sort or Select Column
In order to disable Sor, set property HeaderClickAction = Select.Ex: UltraWinGrid.DisplayLayout.Override.HeaderClickAction = Select
If you dont want to Select column after set HeaderClickAction = Select, set property:
UltraWinGrid.DisplayLayout.Override.SelectTypeCol = None
Goodluck
Hello,
i want to force the users to sort the winGrid by clicking on only 2 specific columns.
so whenever they click one of these 2 specific columns i want to enable a custom code to sort the grid.
ex: when they click on column_ItemOrder or Column_Counter the following sorting criteria should take place:
UltraGridBand band = this.grdBOQ.DisplayLayout.Bands[0];band.Columns["ItemOrder"].SortIndicator = SortIndicator.Ascending;band.Columns["FullName"].SortIndicator = SortIndicator.Ascending;band.Columns["Counter"].SortIndicator = SortIndicator.Ascending;
if they click on any Other columns than (column_ItemOrder or Column_Counter) i don't want the grid to be sorted in any possible way.
Where should i write the code that you suggested?
Thanks alot
I would use the BeforeSortChange event. The event gives you a collection of column headers with the new SortIndicator applied. So you can examine the collection and if there is a column in there that you do not want to allow the user to sort, you can remove it. If you want to keep three columns sorted together, then you can check the SortIndicator on those columns and make sure they are all synchronized.
You could also disable sorting on individual columns by setting the SortIndicator property on that column to Disabled.