This is a migrated thread and some comments may be shown as answers.

Empty message?

3 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
msigman
Top achievements
Rank 2
msigman asked on 18 Oct 2010, 10:08 PM
Is there a way to make the radgrid display a message when there is no datasource?  (This is helpful when the radgrid is first displayed)

NoRecordsTemplate

 

 

only works when the datasource is empty (not null).

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Oct 2010, 07:55 AM
Hello Mathew,

Set the DataSource for the grid initially as shown below to show the headers even if you have no records.

code:
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        rdgDept.DataSource = String.Empty;
    }
}



-Shinu.
0
msigman
Top achievements
Rank 2
answered on 19 Oct 2010, 03:33 PM
Thank you for the reply.  Yes, I understand this will display the NoRecordsTemplate.  However, I'd like to have a separate message when there are no records.  I want to display a prompt like "Please fill out form to view results" when there is no datasource.  If the user fills out the form and there are no results, I'd like to display something like "Sorry, no records were found."
0
Pavlina
Telerik team
answered on 20 Oct 2010, 09:06 AM
Hi Matthew,

More details about NoRecordsTemplate can be found in the help topic below:
http://www.telerik.com/help/aspnet-ajax/grdnorecordstemplate.html

Sincerely yours,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
msigman
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
msigman
Top achievements
Rank 2
Pavlina
Telerik team
Share this question
or