3 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 16 Jun 2009, 04:39 AM
Hello Chris,
You can set the ShowHeadersWhenNoRecords property of the ownertableview to true.
aspx:
Also when the datasource for the RadGrid is null(when no records), you can try setting it as shown below:
c#:
Thanks
Princy.
You can set the ShowHeadersWhenNoRecords property of the ownertableview to true.
aspx:
<telerik:RadGrid ID="RadGrid2" runat="server" > |
<MasterTableView ShowHeadersWhenNoRecords="true" > |
Also when the datasource for the RadGrid is null(when no records), you can try setting it as shown below:
c#:
if (RadGrid1.DataSource == null) |
{ |
RadGrid1.DataSource = new string[] { }; |
} |
Thanks
Princy.
0
Chris
Top achievements
Rank 1
answered on 16 Jun 2009, 09:50 PM
That works but what if the grid is in a RadPageView or what if it's in FormTemplate inside a RadePageView. How would I access RadGrid1.DataSource ?
0
Princy
Top achievements
Rank 2
answered on 17 Jun 2009, 06:02 AM
Hello Chris,
When the RadGrid is placed in the RadPageView, you can directly access the grid and set its DataSource using its ID:
aspx:
c#:
If the RadGrid is nested inside a FormTemplate, then you can access the FormTemplate and then using its FindControl() method access the RadGrid.
If this does not help, consider pasting your aspx code here.
Thanks
Princy.
When the RadGrid is placed in the RadPageView, you can directly access the grid and set its DataSource using its ID:
aspx:
<telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" RenderSelectedPageOnly="false"> |
<telerik:RadPageView runat="server" ID="RadPageView1"> |
<telerik:RadGrid ID="RadGrid1" AllowPaging="true" PageSize="5" AutoGenerateColumns="true" runat="server"> |
<MasterTableView> |
</MasterTableView> |
</telerik:RadGrid> |
</telerik:RadPageView> |
<telerik:RadPageView ID="RadPageView2" runat="server"> |
Any Text: |
<br /> |
Any Number: |
</telerik:RadPageView> |
</telerik:RadMultiPage> |
c#:
RadGrid1.DataSource = dt; |
If the RadGrid is nested inside a FormTemplate, then you can access the FormTemplate and then using its FindControl() method access the RadGrid.
If this does not help, consider pasting your aspx code here.
Thanks
Princy.