备注显示设置

GridControl详解(五)设置行备注和行号

  设置备注字段

GridControl详解(五)设置行备注和行号

  显示结果:

GridControl详解(五)设置行备注和行号

  可以写入按键事件F3,用以开关备注显示

private void Form4_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F3)
            {
                gridView1.OptionsView.ShowPreview = !gridView1.OptionsView.ShowPreview;
            }
        }

GridControl详解(五)设置行备注和行号

  行号显示要用到的事件:

GridControl详解(五)设置行备注和行号

  代码:

 

private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
    if (e.Info.IsRowIndicator)
    {
        e.Info.DisplayText = "Row " + e.RowHandle.ToString();               
    }
}
gridView1.IndicatorWidth = 70;

显示结果

GridControl详解(五)设置行备注和行号

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-10-13
  • 2021-07-20
  • 2021-06-23
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
相关资源
相似解决方案