Click here to Skip to main content
15,920,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to find EmptyDataTemplate controls on button click.
actualy i have to set visiblility of EmptyDataTemplate cotrols false on load
and have to set visiblility of EmptyDataTemplate controls true on add new button.


Thanks
Manisha
Posted

1 solution

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.
 
Share this answer
 
Comments
ManiV1 30-Apr-12 8:00am    
yeah absolutly fine but if no records are coming then i have to show one message like "No records" and on click of button i have to show emptytemplate controls.
Sandeep Mewara 30-Apr-12 8:56am    
Did you go through link?

This is a 'template' and thus you can design it as per your need. Put a label in it with the needed text.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900