Empty message?

4 posts, 0 answers
  1. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 18 Oct 2010 Link to this post

    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).

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Oct 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 19 Oct 2010 Link to this post

    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."
  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 20 Oct 2010 Link to this post

    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
Back to Top