蓝海豹

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

备注显示设置

  设置备注字段

 

  显示结果:

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

 

  1.     private void Form4_KeyUp(object sender, KeyEventArgs e)  
  2.         {  
  3.             if (e.KeyCode == Keys.F3)  
  4.             {  
  5.                 gridView1.OptionsView.ShowPreview = !gridView1.OptionsView.ShowPreview;  
  6.             }  
  7.         }  
    private void Form4_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F3)
            {
                gridView1.OptionsView.ShowPreview = !gridView1.OptionsView.ShowPreview;
            }
        }

 

  行号显示要用到的事件:

 

  代码:

 

  1. private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)  
  2. {  
  3.     if (e.Info.IsRowIndicator)  
  4.     {  
  5.         e.Info.DisplayText = "Row " + e.RowHandle.ToString();                 
  6.     }  
  7. }  
  8. gridView1.IndicatorWidth = 70;  
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;

 

  显示结果




posted on 2012-12-28 10:50  蓝海豹  阅读(520)  评论(0编辑  收藏  举报