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);

}
}

猜你喜欢

转载自www.cnblogs.com/yourSixUncle/p/10235324.html
Dev