第三方控件中,我们经常用GridLookUpEdit来下拉多条数据,有时候需要隐藏某一列,在9.2之前
Title this.gle1.Properties.DataSource = dt; this.gle1.Properties.ValueMember = "column1"; this.gle1.Properties.DisplayMember = "column2"; string tempStr = string.Empty; //列名 this.gle1.Properties.View.Columns.Clear(); for (int i = 0; i < dt.Columns.Count; i++) { tempStr = dt.Columns[i].ColumnName; DevExpress.XtraGrid.Columns.GridColumn col = this.gle1.Properties.View.Columns.AddField(tempStr); col.VisibleIndex = i; col.Caption = tempStr;
if (tempStr.Equals("column1")) col.Visible = false; }