private static void gv_CustomDrawEmptyForeground(object sender, DevExpress.XtraGrid.Views.Base.CustomDrawEventArgs e)
   {
      DevExpress.XtraGrid.Views.Grid.GridView gv = sender as DevExpress.XtraGrid.Views.Grid.GridView;
      DataView bindingSource = gv.DataSource as DataView;
      
      if (bindingSource != null & bindingSource.Count == 0)
      {
         Font f = new Font("宋体", 16, FontStyle.Bold);
         Rectangle r = new Rectangle(gv.GridControl.Width / 2 - 100, gv.GridControl.Height / 2, e.Bounds.Right - 5, e.Bounds.Height - 5);
         e.Graphics.DrawString("没有查询到数据!", f, Brushes.Red, r);
      }
   }

 

相关文章:

  • 2021-12-19
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2021-08-12
  • 2021-08-18
  • 2021-12-12
猜你喜欢
  • 2021-07-05
  • 2021-11-27
  • 2021-04-13
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-08-04
相关资源
相似解决方案