I have a webgrid which displays the headers and group by box even if there is no data to display. How do I display a message 'Your search criteria have given no results.Please re-try with a different search criteria' when there is no data to display?
I believe the NoDataMessage property directly on the DisplayLayout settings may be helpful in your case, for example:
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server"> <DisplayLayout NoDataMessage="No Data Displayed"><igtbl:UltraWebGrid>
In the case where you want to hide the grid altogether (columns and everything), you can set the Visible property of the grid to false and display a label with custom message if the datasource has 0 rows.
Hope this helps.
I have tried using the NoDataMessage without any effect.I am using Sqldatasource .
Is there something similar to '<EmptyDataTemplate' (available in gridview)
in ultrawebgrid
In the SqlDataSource's .Selected hanler, you might try hiding the grid and showing your "try again" message.
Not elegant, but it'll work.
Thanks. I added the visiblity code in Selected handler and it works.
I was just wondering why the EmptyDataTemplate has not been not provided.