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

want to show Empty item template if list returned is null

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saravanan k
Top achievements
Rank 1
saravanan k asked on 12 Apr 2010, 10:46 AM
hi,
    
    i have a radgrid in my page. in the need_datasource method i assign the grid's datasource to a list of objects returned from the business layer. but my problem is if the list is returned as null, (means no records) the grid disappears. i want the grid to show the empty item template. how to achieve this? please help.

Regards,
Saravanan K

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 15 Apr 2010, 07:28 AM
Hi Saravanan,

Thank you for contacting us.

The grid will not be visible if the DataSource for the grid is null. To achieve the desired functionality and show the RadGrid's empty item template when no records, you could try setting a blank object to the grid's datasource if it is null:
if(listReturnedFormBusinessLayer == null)
{
   RadGrid1.DataSource = new string[] { };
}
else
{
    RadGrid1.DataSource = listReturnedFormBusinessLayer
}

If you need further assistance, do not hesitate to contact us again.

Regards,
Radoslav
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
saravanan k
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or