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

[Solved] Empty grid display problem...

3 Answers 319 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krzysztof
Top achievements
Rank 1
Krzysztof asked on 13 Jan 2010, 03:13 PM
Hello Experts.
Why my grid looks once like in print screen 1, and once he is not at all? (screen 2)
How to force the appearance of 1 ?

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 14 Jan 2010, 07:34 AM
Hello,

             The GridControl will not be visible if the DataSource for the grid is empty, i.e., if you have set
RadGrid1.DataSource = null or RadGrid1.DataSourceID = String.Empty.
             If this is the case, you can replace this code by using 'RadGrid1.DataSource= new string[] {}' instead, which will render the RadGrid on the page even when no records are present.

You can also try setting the ShowHeadersWhenNoRecords property of the MasterTableView to true as shown below:
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"
      <MasterTableView CommandItemDisplay="Top" ShowHeadersWhenNoRecords="true" > 
      .....        

Thanks
Princy.
0
Radoslav
Telerik team
answered on 14 Jan 2010, 12:45 PM
Hello Krzysztof,

I think that somewhere in your code you set null to the DataSource  of the RadGrid. If it is null the RadGrid does not display its empty message and looks like in the screen 2. To avoid this you could set a blank object to the grids datasource if it is null:

RadGrid1.DataSource = new int[] { };

If that is not helps please open a support ticket and provide a sample app that recreates this problem. It is hard to say what is causing this problem without seeing some code.  You could open a formal support ticket from your Telerik account and attach a ZIP file there. We will check it and do our best to help.

Best wishes,
Radoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Krzysztof
Top achievements
Rank 1
answered on 19 Jan 2010, 07:50 AM
Thank you for help and I apologize with the delay in response.
Tags
Grid
Asked by
Krzysztof
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Radoslav
Telerik team
Krzysztof
Top achievements
Rank 1
Share this question
or