Enabling and disabling of columns in Infragistics UltraGrid

早过忘川 提交于 2019-12-05 03:36:16

I suppose that when you talk of disabled columns you mean disable editing in these columns. Also you don't specify the language, so I will use C#

UltraGridColumn c = grdWork.DisplayLayout.Bands[0].Columns["YourColumnName"];
c.CellActivation = Activation.NoEdit; 
c.CellClickAction = CellClickAction.CellSelect;

The property CellActivation could also be set to Activation.Disabled or Activation.ActivateOnly.
The property CellClickAction allows to set an appropriate selection status for the cell clicked. You could use CellSelect or RowSelect. (This last one, to mimic the behavior of a ListBox)
As usual, the real difficulty is to find the correct property. Then Intellisense will give you a quick and fair explanation of the meaning of these values.

If you just want to show and hide the columns as needed then you can try the following.

UltraGrid myGrid = new UltraGrid();
//Bind to your data here
myGrid.DisplayLayout.Bands[0].Columns["ColumnName"].Hidden = true;
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!