Devexpress GridControl

爷,独闯天下 提交于 2019-12-21 11:01:57

1、隐藏“Drag a column header here to group by that column”如下:

选择gridview->属性

选择OptionView->ShowGroupPanel->false

2、关于gridcontrol显示标题(Caption):

     选择gridcontrol——》run designer

新建列 Column

Caption用来显示标题,ColumnEdit  选择显示控件的类型  ,FileName 需要绑定现实的字段(类的属性或者数据库列名)

3、gridControl 分组显示 (例如按照translator分组)

1  gridView3.Columns["translator"].GroupIndex = 0;
2  gridView3.ExpandAllGroups();
3  gridView3.GroupSummary.Add(SummaryItemType.None, "translator", null);

4、gridview 显示行号

1 private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)  
2 {  
3     if (e.Info.IsRowIndicator)  
4     {  
5         e.Info.DisplayText = "Row " + e.RowHandle.ToString();                 
6     }  
7 }  
8 gridView1.IndicatorWidth = 70;  

5、隐藏显示行号的那一列

   RunDesigner->Views->Options->OptionsView->ShowIndicator 即可

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!