如何在GridView的中心显示错误消息 [英] How to display Error Message in center of gridview
本文介绍了如何在GridView的中心显示错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我使用gridview,因为我在gridview中使用EmptyDataText向用户显示错误消息,但在顶部标题gridview上显示错误.我想在gridview的中心显示.我也尝试使用
In my application i am use gridview in that i m using EmptyDataText in gridview to dispaly error message to user but it dispaly error on top header gridview. i want to dispaly in centr of gridview. i m also try it using
<EmptyDataRowStyle VerticalAlign ="Middle" />
进行尝试,但它再次显示在top
but it shown again in top
推荐答案
中,您必须使用EmptyDataTemplate而不是EmptyDataRowStyle!
当数据源为空时显示EmptyDataTemplate,而当当前项目为空时显示EmptyItemTemplate!
使用模板!
you have to use EmptyDataTemplate not EmptyDataRowStyle!
EmptyDataTemplate shown when datasource is empty, and EmptyItemTemplate when the current item is empty!
use templates!
您可以使用
YOu can use
<emptydatatemplate></emptydatatemplate>
并且您可以在其中添加具有样式和更多样式的DIV
and in this you can add DIV with styles and many more
这篇关于如何在GridView的中心显示错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文