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

Display filter icon on mouseover and when filter is applied

6 Answers 574 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rob
Top achievements
Rank 1
Rob asked on 29 Nov 2011, 08:57 AM
Hi,

I would like to achieve the following with the filtering option in the gridview:

1. Make the filter icon only visible on mouseover of the header.
I partly achieved this by changing the GridViewHeaderCellStyle. However there are a few issues. When a column is sorted, the filter icon isn't visible onmouseover. So this isn't an acceptable solution. I also tried to use different visualstategroups, but couldn't get this to work properly either.

2. I would like to have the filter icon visible when a filter is applied. I investigated the options of achieving this through the GridViewHeaderStyle as well as through the DistinctFilterControlTemplate but I was unable to find a solution.

I have already gone through some examples in the forum (http://www.telerik.com/community/forums/silverlight/gridview/ui-suggestion.aspx , http://www.telerik.com/community/forums/silverlight/gridview/complete-style-and-template-change-help.aspx) but these don't do exactly what I want.

Any help would be appreciated.


Kind regards,

Rob Houweling
Expression Blend MVP

6 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 29 Nov 2011, 09:52 AM
Hi Rob,

 
Indeed this is the right approach. If you want to override the default behavior you should predefine the template of the GridViewHeaderCell and manipulate the Visibility of the filtering drop down in the corresponding states-MouseOver and Sorting(Ascending/Descending). Regarding your second queston about showing the icon when the filter is applied - since the filter is not visible when the filter is applied you should manually access this element and manipulate it in the way you need. 
I am attaching you sample project which demonstrates how this can be achieved. 



Greetings,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Rob
Top achievements
Rank 1
answered on 30 Nov 2011, 03:05 PM
Thanks for this.
There are a number of things not working as I would like them to.
1. The filter icon is always visible when a column is sorted. I want the filtering icon to have the same behavior whether an column is sorted or not. I only want the icon to be visible when no mouseover, that is when filtering is applied.
2. How would I go about accessing the filter icon manually? I don't see that in your attached example.

Thanks again.


Kind regards,

Rob Houweling
Expression Blend MVP
0
Rob
Top achievements
Rank 1
answered on 30 Nov 2011, 03:05 PM
--deleted--
0
Dean Wyant
Top achievements
Rank 1
answered on 20 Apr 2012, 09:25 PM
This is exactly how I would like the filter icon to work.
It should always be displayed when a filter is defined and only show up on mouse over if no filter is defined.
Is there a set of styles / templates and code available that acheives this completely?

0
Nitish
Top achievements
Rank 1
answered on 13 Aug 2012, 09:56 PM
the provide sample is the functionality I'm looking for. But there seems to be an issue with filter popup window. Is it possible to re-post the code after fixing it?
When you hover over the header cell the filter icon is displayed and when you click on it, filter window is shown. but usually you don't see the filter window the first time itself and by the time you hover on to the filter popup window, the window vanishes as the state is back to normal.
0
Dean Wyant
Top achievements
Rank 1
answered on 26 Oct 2012, 08:43 PM
It seems to me that the example provided is not going to be fixed and nobody is going to provide an example that actually works.
So, I guess the answer to this issue is:
"This should be possible, but we are not sure how to fully implement it. This feature is not part of the control. Perhaps someone will share a working implementation some day."




Tags
GridView
Asked by
Rob
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Rob
Top achievements
Rank 1
Dean Wyant
Top achievements
Rank 1
Nitish
Top achievements
Rank 1
Share this question
or