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

[Solved] Trap when filter returns no result

1 Answer 90 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.
Helene Dumas
Top achievements
Rank 1
Helene Dumas asked on 08 Jun 2010, 07:02 PM
Hello,
When the client uses the filter and it returns no result, I would like to give him a message that says that there is no result for the criterias he entered.
How would this be possible??

Thank you.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 09 Jun 2010, 07:54 AM
Hello Helene Dumas,

You can check that the grid is empty and perhaps show an alert showing that. Use the OnDataBound client side event of the grid and check if its total field is equal to zero:

<script type="text/javascript">

function onDataBound() {
    var grid = $(this).data('tGrid');
    if (grid.total == 0) {
         alert('The filtering operation returned no results!');
    }
}

</script>


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