Documents & Files - Show "No Documents found"

Posted by Community Admin on 04-Aug-2018 22:31

Documents & Files - Show "No Documents found"

All Replies

Posted by Community Admin on 02-Mar-2011 00:00

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

Posted by Community Admin on 03-Mar-2011 00:00

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

Posted by Community Admin on 26-Apr-2013 00:00

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?

Posted by Community Admin on 30-Apr-2013 00:00

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

Posted by Community Admin on 22-Nov-2013 00:00

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?

Posted by Community Admin on 26-Nov-2013 00:00

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

Posted by Community Admin on 04-Jun-2015 00:00

Any resolution to this? Seems that a bug found in 2008 should have been fixed by 2015???

This thread is closed