Filter Button Missing from RadGrid Header After Adding a Custom Skin.

1 Answer 51 Views
Button Filter Grid
Doru
Top achievements
Rank 1
Doru asked on 30 Apr 2021, 11:51 AM | edited on 30 Apr 2021, 11:52 AM

Hello,

I'm currently working on a project where I have a RadGrid displaying some data. The filter functionality is already implemented and I've created a custom skin from an existing embedded skin for the GridDateTimeColumn and implemented according to the documentation here. Everything works perfect except that upon adding the <FilterTemplate> and setting the custom skin for the <telerik:RadDatePicker> the filter button it's not generated anymore. I've inspected the page and indeed the button is not just hidden with CSS or missing it's icon, it's not present at all in the HTML and the result is in the pictures attached.

Here is the markup I'm using.

<telerik:GridDateTimeColumn DataField="foo" UniqueName="foo" HeaderText="foo" PickerType="DatePicker" DataFormatString="{0: MM/dd/yyyy}" FilterDateFormat="MM/dd/yyyy" ReadOnly="true">
     <HeaderStyle Width="130" Font-Bold="true" />
          <FilterTemplate>
               <telerik:RadDatePicker runat="server" Skin="MyCustomSkin" EnableEmbeddedSkins="false"></telerik:RadDatePicker>
          </FilterTemplate>
 </telerik:GridDateTimeColumn>

Once I remove the <FilterTemplate> and return the skin to default the Filter button is displayed. I've looked for solutions but I couldn't seem to find any. What's causing this behaviour? Is it something I'm missing? 

 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 05 May 2021, 10:37 AM

Hi Doru,

The Filter button is part of the built-in filtering and if you use Templates, that will not be rendered anymore. With that in mind, it is expected that there won't be a filter button anymore.

The Purpose of the FilterTemplate is to replace the built-in functionality and provide a Placeholder for your custom content. There you can add custom controls to be used as filter controls.

For the FilterTemplate to work, add a control you will be using as the FilterControl and use the Client-Side events/APIs of that control to call the filter method for the Grid when selection changes. Check out the Filter Templates Online example to see how ComboBoxes are used as filter controls.

Speaking of the structure and icon, you can still achieve the same or similar appearance as if it was a built-in filter by adding both the filter control and a button that will display a filter icon. You could use that button to open a RadContextMenu on click just like the built-in filtering would do. The context menu that opens would contain the filter functions of your choice. Upon clicking on the Menu item (filter function) you could get the selected dates from the customs control and call the filter method of the Grid.

Regards,
Attila Antal
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

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