查询不到数据时显示 没有查询到数据
gridView1.CustomDrawEmptyForeground += new DevExpress.XtraGrid.Views.Base.CustomDrawEventHandler(gridView1_CustomDrawEmptyForeground);
void gridView1_CustomDrawEmptyForeground(object sender, DevExpress.XtraGrid.Views.Base.CustomDrawEventArgs e)
{if (gridView1.RowCount==0)
{
Font f = new Font("宋体", 10, FontStyle.Bold);
Rectangle re = new Rectangle(e.Bounds.Top + 5,
e.Bounds.Left + 5,
e.Bounds.Right - 5,
e.Bounds.Height - 5);
e.Graphics.DrawString("没有查询到数据", f, Brushes.Black, re);
}
}