如果datagrid连接到的数据库没有数据,能不能也显示出来标题?
我现在是什么都不显示,这样界面就不好看了。

解决方案 »

  1.   

    add a #table like this:if count(tableA.Column1) = 0插入一条空数据...这样你的临时表中会有一条数据,但是都是“空”类型(注意  不是null)
      

  2.   

    http://community.csdn.net/Expert/topic/3439/3439267.xml?temp=.8204462
      

  3.   

    设置 panel,隐藏datagrid,显示没有查询到数据
      

  4.   

    谢谢各位。
    能不能这样,如果没数据,就显示标题和页脚(FooterTemplate)?
    因为我的页脚上面有textbox。
      

  5.   

    方法很多,我只写两种
    一种在sql语句中在每个field加上 as fieldname 如:select field1 as 姓名,....from ....
    二是:用邦定列,在每列上的headertext加上姓名就行了