Documents & Files - Show "No Documents found"
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
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
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?
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();
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?
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
Any resolution to this? Seems that a bug found in 2008 should have been fixed by 2015???