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

NoRecordsTemplate Not Showing

1 Answer 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 25 Nov 2008, 02:30 PM
Hello,

I have a RadGrid being bound via the DataSource property.  Null is being bound to the control because there are no records, and DataBind() is being called.  But my NoRecordsTemplate isn't being shown; instead, I see a horizontal line and that's it.  No template content.  How do I get this to work?  I'm not doing anything special and I have EnableNoRecordsTemplate set to true.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 25 Nov 2008, 04:09 PM
Hello Brian,

If there are no records, you need to bind the RadGrid to an empty collection. If you set the DataSource to null, this is the same as if the control is not bound at all.

C#
<GridInstance>.DataSource = new Object[0];

VB
<GridInstance>.DataSource = new Object(){}

http://www.telerik.com/community/forums/aspnet/grid/how-to-keep-empty-grid-appearing.aspx


Best wishes,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or