Header Context menu Indicate Filtered column in header ?

1 Answer 28 Views
Filter Grid
GDPR_erased
Top achievements
Rank 1
GDPR_erased asked on 26 May 2022, 09:31 PM

Is there a better way, or built-in way, when an Item gets Filtered using the drop-down menu, to show it in the header cell like it does when you sort.

I found an old thread and copied it to my Item Command, so an image is shown for now.
Am I missing a setting to do it automatically?  I let them choose the Theme, so I can't arbitrarily impose a syle on the Header.

Thanks

David


            if (e.CommandName == RadGrid.HeaderContextMenuFilterCommandName)
                {
                Triplet arguments = e.CommandArgument as Triplet;
                Pair filter1 = arguments.Second as Pair;
                Pair filter2 = arguments.Third as Pair;
                GridColumn column = (rgCOREPARTS  as RadGrid).MasterTableView.GetColumn(arguments.First.ToString());
                if (filter1.First.ToString() == "NoFilter" && filter2.First.ToString() == "NoFilter")
                    {
                    column.HeaderText = column.UniqueName;
                    }

                else
                    {
                    column.HeaderText = column.HeaderText + "<img src = 'https://hq.certifiedtransmission.com/ufo/Images/Filter02.png' style='float: right;'>";
                    }
                }


1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 31 May 2022, 07:02 AM

Hi David,

I'm afraid there is no built-in way of indicating the filtered columns for the HeaderContextMenu. However, we have a Code Library sample that you can follow to implement a Visual indicator.

Please visit the Visually indicate filtered columns in RadGrid with Excel-Like Filtering article, inspect the implementation or download and test the sample to see it in action.

I hope this will be helpful.

Regards,
Attila Antal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Filter Grid
Asked by
GDPR_erased
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or