private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
if (e.Info.IsRowIndicator && e.RowHandle > -1)
{
e.Info.DisplayText = (e.RowHandle + 1).ToString();
}
}
#region GridView 显示行号 设置行号列的宽度
public void DrawRowIndicator(DevExpress.XtraGrid.Views.Grid.GridView gv, int width)
{
gv.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(gridView1_CustomDrawRowIndicator);
if (width != null)
{
if (width != 0)
{
gv.IndicatorWidth = width;
}
else
{
gv.IndicatorWidth = 50;
}
}
else
{
gv.IndicatorWidth = 50;
}
}
#endregion
转载请注明原文地址:https://ipadbbs.8miu.com/read-28797.html