private void gridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
{
if (e.Info.Kind == DevExpress.Utils.Drawing.IndicatorKind.Header)
{
e.Appearance.BackColor = Color.Red;
e.Appearance.DrawBackground(e.Cache, e.Bounds);
e.Appearance.DrawString(e.Cache, "序号", e.Bounds);
e.Handled = true;
}
if (e.Info.IsRowIndicator && e.RowHandle >= 0)
{
e.Info.DisplayText = (e.RowHandle + 1).ToString();
}
}
c# dev gridcontrol设置自动序号,并设置序号列背景
于 2024-09-01 16:04:28 首次发布