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

Custom filter control to show up even when there are no results

5 Answers 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 29 Aug 2011, 08:42 PM
Hi,

We have a custom filtering control that were using to implement server side filtering.  We are not planning on using anything that does in memory filtering like the default of what the telerik filtering stuff does.

We have all of this working except that when there are no results and you click on the filter button in the column header the control doesnt show up.  Is there a way to enable it where clicking the filter button in the column header always shows the control?  If we can do it this way were going to have to completely write our own control that is a button with a popup below it and put them into each of the column headers.

Thanks

5 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 30 Aug 2011, 11:19 AM
Hello Jason,

The fact whether the custom filtering control shows up should not have anything to do with whether there is data or not, but you never know. Is the Prepare method of your custom control called when the user clicks the funnel? It should be.

Could you please send us a very small dummy mock sample project that exhibits this behavior and we will immediately take a look to see what exactly is going on. The custom filtering control may be completely empty and dummy.

Thanks in advance.

Best wishes,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Jason
Top achievements
Rank 1
answered on 30 Aug 2011, 12:22 PM
Hi Ross,

Your absolutely right.  When i setup a brand new project using the default styles but with the same behavior around using a custom filter control it works even if the ItemsSource is null or has an empty collection.  We must have messed something up in our styles that makes the filter button in the header not clickable when there is no data.

Thanks.
0
Rossen Hristov
Telerik team
answered on 30 Aug 2011, 12:49 PM
Hello Jason,

The easiest way to pinpoint the problem would be to see whether the Prepare method is called. By design this Prepare method is called every single time the user clicks on the filtering funnel. Alternatively, you can use Silverlight Spy to see what exactly happens when you click on the funnel. You can inspect the visual tree.

Let me know if I can help with anything else.

Best wishes,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Jason
Top achievements
Rank 1
answered on 30 Aug 2011, 01:11 PM
Yeah the prepare method is not being called.  In fact i dont even get the hand symbol as if to be able to click on it when there are no results.  We must have messed something up in our styles to disable the controls in the header if there are no results.
0
Rossen Hristov
Telerik team
answered on 30 Aug 2011, 01:15 PM
Hello Jason,

In this case you should compare the current state of your header cell with the default one. Here is the template structure of the header cell. The funnel responsible for showing the filtering control is called PART_DistinctFilterControl (the name is stupid I know) and is of type FilteringDropDown. 

What you can do is take a default grid and your "broken" one and inspect them both with Silverlight Spy simultaneously. Compare the contents of the header cell and see where is the difference. This might help you identify where the mess up has occurred.

I hope this helps.

Regards,
Ross
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
GridView
Asked by
Jason
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Jason
Top achievements
Rank 1
Share this question
or