How to connect custom behavior to filtering column?

0 Answers 65 Views
GridView
Szymon
Top achievements
Rank 1
Szymon asked on 15 Jun 2023, 01:07 PM
In my project I have RadGridView with GridViewDataColumns. Some of the rows are connected with each other. For some of them default filtering using FilteringDropDown is enough, since they have the same value in filtered column. But there are also columns where the values for interconnected rows are different and if we filter it by deafault we lose that connection and we only present row with that value and the connected row is lost. Is there possibility to override some function and perform the custom filtering there. If yes how to do that?
Or do I need some new control there based on the deafault filtering popup to perform filtering there?
Dimitar
Telerik team
commented on 19 Jun 2023, 08:00 AM

Hi Szymon, 

In general, the following articles are showing how you can customize the filtering:

However, I am not sure how the rows are connected in this case. This is why I want to ask you to create a small project that shows your case (with some sample data) and send it to us. This way we will be able to better understand your scenario and provide a solution if possible.

Thank you in advance for your patience and cooperation. I am looking forward to your reply.

Szymon
Top achievements
Rank 1
commented on 22 Jun 2023, 08:08 AM

When I have more time I will probably post some example here, but right now i can describe the solution which I developed for my case.
I subscribed to the Filtered event of RadGridView and  in there I found the filtered Items(RadGridView.Items) and from that collection I obtain the list of Ids of interconnected rows and then for each Id I create CompositeFilterDescriptor for column with that Ids with OR as a logical operator and after that I add my composite filter to RadGridView.FilterDescriptors.

Dimitar
Telerik team
commented on 22 Jun 2023, 10:24 AM

Hi Szymon, 

Thank you for sharing your solution. I am sure the community will benefit from it.

Regards,

Dimitar

Szymon
Top achievements
Rank 1
commented on 22 Jun 2023, 01:46 PM

I have another question on that issue since I am using such an code snippet( :

RadGridView.FilterDescriptors.Clear();
RadGridView.FilterDescriptors.Add(compositeFilter);

And clearing FiltersDescriptors is broking the working  of filtering pop up funnel(it is not changing the color when filtering is applied). how to fix that?

 

Szymon
Top achievements
Rank 1
commented on 22 Jun 2023, 02:31 PM

I resolved that in another way. The sulotion is not to clear FilterDescriptors, but after adding set LogicalOperator to OR and that resolves the issue.
Dimitar
Telerik team
commented on 26 Jun 2023, 05:11 AM

Hi Szymon

I am glad that you have found a solution to this. Please note that it seems to me that this is a very specific scenario. If possible I would suggest using the ticketing system since it allows you to add a project and share more detailed (confidential information). This allows us to investigate the precise requirement and provide better solutions. 

Thank you for your understanding.

Szymon
Top achievements
Rank 1
commented on 27 Jun 2023, 01:56 PM

Hello, 
I have another question is it possible that attaching to the filtered event of RadGridView changes the way how DistinctValues of columnFilterDescriptor works. Becouse in my example I have three tabs which are RadGridViews and for two of them when filtering pop-up is apearing in distinct values place there are always all distinct values are appearing even for filtered rows(here i do not attach for filtered event) and for the last one in distinct values i got only the values for filtered rows(here i attach to the filtered event)

Dimitar
Telerik team
commented on 29 Jun 2023, 08:03 AM

Hello Szymon, 

Just subscribing to an event should not alter the behavior. This seems very specific and I would suggest opening a ticket where you can attach your project or a sample project that reproduces this. This way we will be able to properly investigate it and determine what is causing such a behavior. 

Thank you in advance for your patience and cooperation. 

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Szymon
Top achievements
Rank 1
Share this question
or