DEV GridControl表格数据源为空在表格中间显示提醒字符

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 == )
{
Font f = new Font("宋体", , FontStyle.Bold);
Rectangle r = new Rectangle(gv.GridControl.Width / - , gv.GridControl.Height / , e.Bounds.Right - , e.Bounds.Height - );
e.Graphics.DrawString("没有查询到数据!", f, Brushes.Red, r);
}
}
上一篇:linux常用快捷键


下一篇:python-文件读写