private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
e.Appearance.TextOptions.HAlignment=DevExpress.Utils.HorzAlignment.Far;
if (e.Info.IsRowIndicator)
{
if (e.RowHandle >= 0)
{
e.Info.DisplayText = (e.RowHandle+1).ToString();
}
else if (e.RowHandle < 0 && e.RowHandle > -1000)
{
e.Info.Appearance.BackColor = System.Drawing.Color.AntiqueWhite;
e.Info.DisplayText = "G" + e.RowHandle.ToString();
}
}
}
注意:要设置好indicatorwidth为30
本文介绍如何使用 DevExpress 的 gridView 控件自定义显示行索引,包括如何设置行索引的对齐方式、背景颜色及显示文本等内容,适用于需要精细化控制 GridView 显示效果的场景。
372

被折叠的 条评论
为什么被折叠?



