码迷,mamicode.com
首页 > 其他好文 > 详细

GridControl 无数据时显示信息

时间:2015-04-28 16:12:12      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:devexpress   datagrid   无数据自动提示   

图例:

技术分享

主要代码如下:

说明:给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);            
            }
        }


GridControl 无数据时显示信息

标签:devexpress   datagrid   无数据自动提示   

原文地址:http://blog.csdn.net/u013816709/article/details/45336291

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!