Devexpress GridControl

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

选择gridview->属性

Devexpress GridControl_第1张图片

选择OptionView->ShowGroupPanel->false

Devexpress GridControl_第2张图片

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

     选择gridcontrol——》run designer

Devexpress GridControl_第3张图片

新建列 Column

Devexpress GridControl_第4张图片

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

Devexpress GridControl_第5张图片

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、隐藏显示行号的那一列

Devexpress GridControl_第6张图片

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

你可能感兴趣的:(DevExpress)