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

NoRecordsTemplate Not Working

2 Answers 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 06 Jul 2018, 03:19 PM

I have a RadGrid bound to a ClientDataSource, but when no records are returned, the grid's NoRecordsTemplate does not display (it's just an empty grid).  I've tried various workarounds without any success.  I've tried setting the grid's datasource to an empty array in the RadClientDataSource OnDataParse event.  I've tried explicitly setting EnableNoRecordsTemplate = "true", and I've tried setting NoMasterRecordsText in the MasterTableView, but nothing seems to work.

Any idea what I could be missing?

2 Answers, 1 is accepted

Sort by
0
Accepted
Attila Antal
Telerik team
answered on 16 Jul 2018, 11:30 AM
Hi Eric,

You can take a look at the sample project I have attached. It consists of a NoRecordsTemplate inside RadGrid that is bound on client side. You may compare it with your project to see whether there are  differences between the two.

If the issue still persist, I would advise modifying my sample to produce the error and send it back to us via a formal support ticket where my colleagues will investigate it further.

Kind regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Eric
Top achievements
Rank 1
answered on 16 Jul 2018, 02:28 PM

Thanks, Attila!

Looks like I have some weird issue going on with my column sizing. The NoRecordsTemplate doesn't show, unless I resize the columns like this:

var columns = radGridKitsMTV.get_columns();
for (var i = 0; i < columns.length; i++) {
    columns[i].resizeToFit(false, true);
}

 

For whatever reason, that makes it work.  It's almost like the text from the NoRecordsTemplate is being put into a column that was too compressed to display.  Thanks for the demo project.  That helped.

Tags
Grid
Asked by
Eric
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Eric
Top achievements
Rank 1
Share this question
or