Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telerik Radgrid not displaying in the browser

Telerik Rad control just displaying as solid straight line in the browser. But in the Visual studio design it displaying properly.

<telerik:RadGrid ID="RadGrid1" runat="server" 
        onneeddatasource="RadGrid1_NeedDataSource">
    <MasterTableView ShowHeadersWhenNoRecords="false" AutoGenerateColumns="true">
   <NoRecordsTemplate>
     <div>There are no records to display</div>
   </NoRecordsTemplate>
 </MasterTableView>

    </telerik:RadGrid>

Can some please help me on this

like image 452
AAK Avatar asked Mar 14 '11 17:03

AAK


1 Answers

If the datasource of "RadGrid1" is Nothing/Null the control is effectively not bound even if databind() is called. An empty collection can be bound to the control in order for the NoRecordsTemplate to be displayed.

In VB.net:
RadGrid1.DataSource = new Object() {}

In C#:

RadGrid1.DataSource = new object[] { };
like image 172
ItsPete Avatar answered Oct 16 '22 05:10

ItsPete