gridcontrol 添加行号

gridcontrol 添加行号

    private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
        {
            if (e.Info.IsRowIndicator && e.RowHandle >= 0)
            {
                e.Info.DisplayText = (e.RowHandle + 1).ToString();
            }
        }

有时候行号宽度不够 还需要设置: gridView1.IndicatorWidth = 75;

posted @ 2019-06-11 16:29  grj001  阅读(85)  评论(0编辑  收藏  举报