문제

Currently I'm developing an application with devexpress, and I had set two columns to hide like this:

gridView1.Columns[2].Visible = false;

However, when I run my program, there is an option from the DataGrid called "Selector de Columnas" (in English ColumnChooser). In this option the two columns that I set to be hidden are shown. I don't want the user to see these columns but I still need them, so I just want to hide them.

You can see the problem here

I searched in the online documentation from Devexpress and they state here that columns can be hidden with the ShowInColumnChooser property. However I'm not able to hide these columns in the ColumnChooser. They don't show you any example, just this line of code:

public bool ShowInColumnChooser { get; set; }

I guess this is a property from some Devexpress control, however they don't state how to use it.

도움이 되었습니까?

해결책

All the links you referred to are related to the WPF DXGrid, but as far as I can see from your screenshot, you are working with the XtraGrid (WinForms). If so, you should use the OptionsColumn.ShowInCustomizationForm property as follows:

column1.OptionsColumn.ShowInCustomizationForm = false;

Related help articles:
Column and Card Field Overview
Customization Form

다른 팁

If you want to prevent a specific column from being showed/hidden, set the column's properties OptionsColumn.ShowInCustomizationForm and OptionsColumn.AllowShowHide to false.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top