Dev Gridcontrol每行添加序号或者文本。

private void gdv_Patient_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
{
if (e.Info.IsRowIndicator && e.RowHandle >= 0)
{
var _Gdv = sender as GridView;

if (_Gdv == null) { return; }

string LevelName = _Gdv.GetRowCellValue(e.RowHandle, "LevelName").ToString();//获取到当前行的数据

e.Info.Appearance.ForeColor =Color.Red;//设置文本颜色。

e.Info.DisplayText = LevelName.Substring(0, 2);

}
}

posted @ 2019-01-07 19:59  名字已被使用N次  阅读(1079)  评论(0编辑  收藏  举报