设置gridView 行号 行号宽

gridView1.IndicatorWidth=30; //设置行号宽度

 //对gridView1的CustomDrawRowIndicator事件进行操作 进行行号显示

private static void GridView1_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
{
    if (e.Info.IsRowIndicator && e.RowHandle >= 0)
    {
        e.Info.DisplayText = (e.RowHandle + 1).ToString();
    }
}

 

posted @ 2019-09-10 09:13  枫卍  阅读(276)  评论(0编辑  收藏  举报