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 on 2016-01-08 13:55  夜雨梧桐  阅读(1938)  评论(0编辑  收藏  举报

导航