Hello,
I need to be able to completely replace the control the user gets when clicking on the funnel icon on the column header. I was able to do this by creating my own style targeting the FilterSelectionControl and creating in there a new controltemplate. I was also able to associate the view contained in my ControlTemplate with my viewmodel and I am able to perform many filtering and other operations using this new FilterSelectionControl. My problem is that I cannot find a way to have this control look different depending on which column header the user clicks. What I am looking for is a simple sample or xaml snippet that display a custom FilterSelectionControl containing, say, a texblock with the text of the header of the column clicked, or that at least selectively hides/shows controls in the FilterSelectionControl. Could you provide something like that?
Thank you.
Hello Roberta,
It seems that for some reason the attachment that I am referring to does not pass through. Please take a look at this post and let me know if you are not able to download it.
Sincerely,ZhivkoEntry Level Software Developer
Thank you Zhivko, but I think you forgot to attach the modified project. Can you please do that? Noted that this should have started a different thread. If I cannot figure it out after you sample I may just do that.
I am glad, I could help out.
I followed the steps you suggested and was unable to reproduce the behavior you're describing. I have modified the attached sample application. I am applying filter on a Click event handler of a button located in the custom FilterSelectionControl and the Popup stays open.
Since you are using some custom functionality, I am not able to conclude what can cause such behavior, so please modify it and send it back, or send a small sample project of your own if you have one.
Please note that it is better to create a separate thread for each of your questions. This way the communication would be easier and there would be no confusion about the issues. Also other community members that have similar issues would be able to benefit from the threads too.
Let me know if I can provide any further assistance.
Sincerely, ZhivkoEntry Level Software Developer
Yes! This is exactly what I trying to achieve. Thank you so much. I have another question, if I may (or I could open a new thread?). In my highly customized filter control I perform some advanced filtering actions. I have a button that that applies the changes. This button calls a command on my viewmodel and process the user inout and applied the filter to the (ListCollectionView)CollectionViewSource to which to Itemsource of my xamgrid is bound. The problem is that when I click on this button and the xamgrid gets correctly filtered my FilterSelectionControl closes while I want it to stay open. How can I make it stay open?
I have modified the attached sample application with the functionality you have reported. In your scenario instead of using the DataContext property you can bind the DataTriggers to the Cell.Column.HeaderText, so you will be able to determine the clicked column.
Please take a look at the modified project and let me know if you require any further assistance regarding this matter.