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

[Solved] No rows = No grid

3 Answers 209 Views
Grid
This is a migrated thread and some comments may be shown as answers.
william johnson
Top achievements
Rank 1
william johnson asked on 28 Jan 2010, 05:02 PM
Hi

When my data set returns no rows the grid view control does not display at all

How can i get the grid to display but with a message saying there are no rows

3 Answers, 1 is accepted

Sort by
0
Lenny_shp
Top achievements
Rank 2
answered on 28 Jan 2010, 09:35 PM
try setting this on MasterTableView
ShowHeadersWhenNoRecords="true"
0
william johnson
Top achievements
Rank 1
answered on 29 Jan 2010, 09:09 AM
Hi thanks for your reply

Your suggestion alone did not fix my problem, i needed to use it in conjunction with the following

I needed to make sure that when the search returned no data (null), that i set the drid to have empty datasources, as previously i was only setting datasources if i had data

 

 

 

radGrid.MasterTableView.DataSource = new Object[0];

((GridTableView)radGrid.MasterTableView.DetailTables[0]).DataSource = new Object[0];

 

0
Daniel
Telerik team
answered on 29 Jan 2010, 10:16 PM
Hello William,

As mentioned several times before, this functionality works if your datasource is empty - it won't work if you don't have a datasource at all.
Empty grid display problem...
RadGrid visible even without data
Add New Record Button Not Showing When No Data
Display grid column if no data available
HOW TO SHOW HEADER OF RAD GRID
Show Header when no data

Let us know if you need more information

Best regards,
Daniel
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.
Tags
Grid
Asked by
william johnson
Top achievements
Rank 1
Answers by
Lenny_shp
Top achievements
Rank 2
william johnson
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or