DataTable dt = =Query.GetCustome=(ref customColumnCount); //绑定列
gridView.Columns.Add(new GridColumn() { Name = "NoCHK", FieldName = "NoCHK", Caption = "选择", VisibleIndex =});
gridView.Columns.Add(new GridColumn() { Name = "No", FieldName = "No", Caption = "No", Visible = false });
gridView.Columns["TestNo"].OptionsColumn.AllowEdit = false;
gridView.Columns.Add(new GridColumn() { Name = "NAME", FieldName = "NAME", Caption = "名称", VisibleIndex= });
gridView.Columns["NAME"].OptionsColumn.AllowEdit = false;
gridControl.DataSource = dt;
//自动列宽,会出现横向滚动条
gridView.OptionsView.ColumnAutoWidth = false; //自动列宽
gridView.BestFitColumns();
动态绑定GridControl列,已作记录。
VisibleIndex =0这个要有的,如果没有就不会显示,如果显示或不显示,可以这样做