Hello, lately I straggle with such situation. I retrieve data from database (from one of views) and I bind this List of elements to gridcontrol (devExpress). Next, I want to hide one of the columns and here is the problem...I cannot hide the column without the knowledge about the column name...The column name is different than property name....(ex. TD_Table is changed to TdTable). Is there any possibility that the generated property name is the same as in database? or Can I obtain the list of columns names (I need this list in design time)?
Pleas help,
Greg
DotConnect for oracle, column name.
I have tried dotConnect for Oracle 5.25.44 and DevExpress 9.2.6:
1) created a WinForms project;
2) generated typed Devart DataSet via DataSet Wizard (Tools | Oracle | DataSet Wizard);
3) placed DevExpress.XtraGrid.GridControl to Form Designer, assigned its DataSource property to the table from my DataSet;
4) GridControl's context menu -> Run Designer | selected the Columns section from the Main window and deleted the unnecessary column from the Columns list.
It works. This column is not displayed on GridControl anymore. Is that what you mean?
1) created a WinForms project;
2) generated typed Devart DataSet via DataSet Wizard (Tools | Oracle | DataSet Wizard);
3) placed DevExpress.XtraGrid.GridControl to Form Designer, assigned its DataSource property to the table from my DataSet;
4) GridControl's context menu -> Run Designer | selected the Columns section from the Main window and deleted the unnecessary column from the Columns list.
It works. This column is not displayed on GridControl anymore. Is that what you mean?
I don't want to use designer...better choice is execute this in code ex.
Here I need a column name...In .net controls(for MSSQL) columnName is always the column name from database and in your product TD_Table is changed to TdTable...Is there any possibility to obtain the columnName for particular Property?
Greg
Code: Select all
(gridView.MainView as GridView).Columns["columnName"].Visible=False;
Greg