且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在单击按钮时找到EmptyDataTemplate控件.

更新时间:2021-10-12 08:21:02

如果它是一个空的数据模板,要隐藏什么?它已经是一个已定义的模板,如果数据源中没有数据或将其隐藏,该模板将是可见的.您不需要为此编写任何可见性代码.

在这里查看: MSDn:GridView.EmptyDataTemplate属性 [ ^ ]
当绑定到控件的数据源不包含任何记录时,将在GridView控件中显示空数据行.您可以使用EmptyDataTemplate属性为空数据行定义自己的自定义用户界面(UI).
If it''s a emptydatatemplate, what''s in to hide? It''s already a defined template that would be visible if no data in datasource or else hidden. You don''t need to write any visibility code for it.

Look here: MSDn: GridView.EmptyDataTemplate Property [^]
The empty data row is displayed in a GridView control when the data source that is bound to the control does not contain any records. You can define your own custom user interface (UI) for the empty data row by using the EmptyDataTemplate property.