How to hide devexpress XtraGrid column

That's it, I use devexpress XtraGrid in a C # .NET application. At runtime, I want to hide 1 XtraGrid column and access that column in the code behind the page. And please help access the XtraGrid rows and columns.

thank

+3
source share
4 answers

You should use the View.Columns [someFieldName] .Visible property to hide / show the column. See also the following topic:

http://documentation.devexpress.com/#WindowsForms/CustomDocument753

+5
source

To hide the column from the user set, the visible property will be False, as described above.

SelectColumn, .

Grid Header → Select Columns → → .

. , :

  • OptionColumn.AllowShowHide False. , .

  • , . , GridView - OptionMenu- > EnableColumnMenu False. . , , ..

+8

: ColumnName.Visible=False;

0

Ok. , xtraGrid, , ( ).

        int myCount;
        try { myCount = this.gridView2.Columns.Count; }
        catch { myCount = 0; }

        for (int j = 0; j < myCount; j++)
        {
            this.gridView2.Columns[j].Visible = false;
        }

, .

0

Source: https://habr.com/ru/post/1762587/


All Articles