您的位置:首页 > 其它

Devexpress之GridControl显示序列号

2017-01-23 15:53 162 查看
先上图:

1  private void gvMachine_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
2         {
3             e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
4             if (e.Info.IsRowIndicator)
5             {
6                 if (e.RowHandle >= 0)
7                 {
8                     e.Info.DisplayText = (e.RowHandle + 1).ToString();
9                 }
10                 else if (e.RowHandle < 0 && e.RowHandle > -1000)
11                 {
12                     e.Info.Appearance.BackColor = System.Drawing.Color.AntiqueWhite;
13                     e.Info.DisplayText = "G" + e.RowHandle.ToString();
14                 }
15             }
16         }


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: