码迷,mamicode.com
首页 > 其他好文 > 详细

gridControl主子表怎样隐藏子表的列

时间:2017-06-15 17:17:54      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:obj   date   control   tail   tom   idc   event   ast   for   

private void grvDetail_MasterRowExpanded(object sender, DevExpress.XtraGrid.Views.Grid.CustomMasterRowEventArgs e)
{

DevExpress.XtraGrid.Views.Grid.GridView aView = grvDetail.GetDetailView(e.RowHandle, e.RelationIndex) as DevExpress.XtraGrid.Views.Grid.GridView;
//grvDetail.BeginUpdate();
//this.gridView1.Columns["moid"].Visible = false;
//gridView1.Columns["moid"].OptionsColumn.ShowInCustomizationForm = false;
//grvDetail.EndUpdate();
//DevExpress.XtraGrid.Views.Grid.GridView aView = (DevExpress.XtraGrid.Views.Grid.GridView)gridView1.GetDetailView(e.RowHandle, 0);

if (aView != null)
{
aView.BestFitColumns();

if (aView.Columns.ColumnByFieldName("moid") != null)
{
aView.Columns["moid"].VisibleIndex = -1;
}

}

}

gridControl主子表怎样隐藏子表的列

标签:obj   date   control   tail   tom   idc   event   ast   for   

原文地址:http://www.cnblogs.com/smallsunand/p/7018720.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!