Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DevExpress gridView Columns Add

I'm using DevExpress library.

I have problem with GridControl the following property is not appear :

gridView1.Columns.Add(); // not appear why ? 

My references are:

using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Columns;
like image 800
SHADOW.NET Avatar asked Mar 19 '23 23:03

SHADOW.NET


2 Answers

Maybe you have not added references in solution explorer..

I follow the steps below:

GridColumn col=new GridColumn();
col.Caption = "Samples";
col.FieldName = "Samples";
gridView1.Columns.Add (col)
like image 134
Sagar Deshpande Avatar answered Mar 24 '23 17:03

Sagar Deshpande


Try the following code

GridColumn column = gridView1.Columns.AddVisible("FieldName", string.Empty);
gridView1.Columns.Add(column);
like image 22
Dmitry Gribkov Avatar answered Mar 24 '23 15:03

Dmitry Gribkov