图例:
主要代码如下:
说明:给GridView添加事件gv_CustomDrawEmptyForeground
private void gv_CustomDrawEmptyForeground(object sender, DevExpress.XtraGrid.Views.Base.CustomDrawEventArgs e) { int num = 100; if (DSMain.Tables[0].Rows.Count < 1) { string str = "没有找到你要查询的数据!"; Font f = new Font("华文中宋", 10, FontStyle.Regular); Rectangle rec = new Rectangle(e.Bounds.Top + num, e.Bounds.Left + num, e.Bounds.Right - num, e.Bounds.Bottom - num); e.Graphics.DrawString(str, f, Brushes.Black, rec); } }
时间: 2024-10-22 08:00:03