+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Documents & Files - Show "No Documents found"

Documents & Files - Show "No Documents found"

7 posts, 0 answered
  1. MNP
    MNP avatar
    79 posts
    Registered:
    23 Apr 2008
    02 Mar 2011
    Link to this post
    If I add in a Documents List Widget and select a Library, if that Library is empty, it will not show "No Documents Found" even though in the template the Grid has:

    <NoRecordsTemplate>No documents found!</NoRecordsTemplate>  

    This is with a Table Type List

    Is there a way to show the NoRecordsTemplate of the grid? 

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Mar 2011
    Link to this post
    Hi Matt,

    This is a property of the RadGrid control, but it looks like that there is an issue when used with the download list. I logged the issue as a bug ID  109538. I updated your Telerik points.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
  3. Dustin
    Dustin avatar
    20 posts
    Registered:
    05 Jan 2012
    26 Apr 2013
    Link to this post
    Has this been addressed yet? When I create a Download List, Select a Library with 0 documents, the NoRecordsTemplate is not showing so clients are assuming the page is empty. I tried to create a javascript page load function (as seen below) and bind the documentsGrid table to an empty datasource, but it doesn't even look like the grid is created in the first place (couldn't find it in the page source even). 

      var dataSource = [];
      var tableView = $find("<%= documentsGrid.ClientID %>").get_masterTableView();  
      alert(tableView.get_dataItems().length.toString());
      if (tableView.get_dataItems().length == 0) 
      {
        $find('<%=documentsGrid.ClientID %>').get_masterTableView().set_dataSource(dataSource);
        $find('<%=documentsGrid.ClientID %>').get_masterTableView().dataBind();
      }

    Anyone have a work around?
  4. Pavel Benov
    Pavel Benov avatar
    341 posts
    Registered:
    14 Mar 2016
    30 Apr 2013
    Link to this post
    Hello guys,

    The problem is coming from the fact that we are setting the grid control to Visible=false if there are no records to display. Additionally we are not binding it to the empty collection, which is also needed for the NoRecordsTemplate to be shown. 

    You can inherit from the MasterTableView class and override the DataBindDocumentList method like so:

    namespace SitefinityWebApp
    {
        public class CustomMasterTableView : MasterTableView
        {
            public override void DataBindDocumentList()
            {
                base.DataBindDocumentList();
     
                if (this.TotalCount == 0)
                {
                    this.DocumentsGrid.Visible = true;
                    this.DocumentsGrid.DataSource = new List<string>();
                    this.DocumentsGrid.DataBind();
                }
            }
        }
    }

    Build and then register the view by going to Administration->Settings->Advanced->ContentView->Controls->FrontendDocuments->Views->MasterTableView.

    In the ViewType field register the type of the custom view following the convention <namespace>.<class> and in our case SitefinityWebApp.CustomMasterTableView. Hit Save and restart the application. Now the NoRecordsTemplate should be displayed if an empty library is selected.

    All the best,
    Pavel Benov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. John
    John avatar
    51 posts
    Registered:
    11 Apr 2013
    22 Nov 2013 in reply to Pavel Benov
    Link to this post
    I have done as you advised here but the Viewtype keeps changing back to the default? How do I get that to stay at the new ViewType?
    And is this even valid for version 6.2?
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    26 Nov 2013
    Link to this post
    Hi John,

    We can see that you have already opened a new thread on the same topic. Lets keep the discussion in the other thread. My colleagues probably did not mention this but when you make changes to the configurations you will need to make a restart of the application so that they can take effect.

    Regards,
    Radoslav Georgiev
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. John
    John avatar
    51 posts
    Registered:
    11 Apr 2013
    04 Jun 2015
    Link to this post
    Any resolution to this? Seems that a bug found in 2008 should have been fixed by 2015???
7 posts, 0 answered