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

[Solved] Handling empty result sets

3 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andy
Top achievements
Rank 1
Andy asked on 18 Mar 2010, 11:00 AM
Hi - probaly an easy one - how do you handle the case of empty data? I am currently getiing a javascript error '0 is null or not an object' (using ajax binding btw)

This happens only when my data results areempty. Shoud I be first checking for thsi case adn NOT be rendering teh grid if it is empty? I expected there to be some way to haev teh grid handl ethis gracefully (declarative NO RESULTS found perhaps)

Cheers,
Andles

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 18 Mar 2010, 02:39 PM
Hi Andy,

Which version are you using? I couldn't reproduce such a problem with the current official release 2010.1.309. Also what are you returning in case of empty data - empty enumerable or null?

Regards,
Atanas Korchev
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.
0
Andy
Top achievements
Rank 1
answered on 19 Mar 2010, 12:59 AM
Ahhh, problem solved. I thought I was returing an empty List<MyObject>, but turns out it was actually a null value. This explains it and resolved my problem.

Though thats only half the story - I was still wondering if there was some way to customise the output for NO RESULTS cases. I know I can just render a different view or partial view and such, but wondered if there was a declative way to have the grid handle this??

Thanks Atanas.
0
Atanas Korchev
Telerik team
answered on 19 Mar 2010, 09:17 AM
Hi Andy,

No, currently there is no way for the grid to handle empty records. I have created a new feature request and you can vote for it.

Regards,
Atanas Korchev
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
Andy
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Andy
Top achievements
Rank 1
Share this question
or