如何使GridView在记录为空的时候显示footer,而不是整个没掉请大家帮忙了

解决方案 »

  1.   

    点开控件的功能菜单 后选最下的“Edit Template” 后选   “EmptyDataTemplate”
    输入字就行
    或在Source中的Gridview 中写   
    <EmptyDataTemplate>
                            <br />
                            输入有误或无此条目,请确认后重新输入!
    </EmptyDataTemplate>
      

  2.   

    没什么好的办法啦,如果没数据就不会显示出来啦,跟FORMVIEW一样。
    可以绑个空数据模版
        <EmptyDataTemplate>
           <table>
              <tr>
                 <td>字段1</td>
                 <td>字段2</td>
                 <td>字段3</td>
              </tr>
            </table>
        </EmptyDataTemplate>
      

  3.   

    指定gridview对象的数据源为一个datatable.if dataset.tables("tablename").rows.count=0 then
    gridview1.ShowHeader=false
    gridview1.showfooter=true
    end if