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

Removing "Or" option from filter

3 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aleks
Top achievements
Rank 1
Veteran
Aleks asked on 25 Feb 2020, 06:18 AM

If I have a column filter configured like this:-

 

            c.Bound(p => p.CreatedDateTime)
                .Title("Created")
                .Filterable(f => f
                    .Operators(o => o.ForDate(d => d.Clear().IsGreaterThanOrEqualTo("On or after").IsLessThan("Before")))
                    .UI(GridFilterUIRole.DateTimePicker)
                )

 

It shows a dropdown for "And" and "Or" between the two filter options. In my case, this doesn't make sense.

Is there a way to specify the options or remove the dropdown?

3 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 27 Feb 2020, 10:07 PM

Hi Aleks,

The "And"/"Or" DropDownList could be removed with custom logic on FilterMenuOpen Grid event. The logic would look like:

.Events(e => e.FilterMenuOpen("onFilterMenuOpen"))
...

<script>
    function onFilterMenuOpen(e) {
        if (e.field == "TimeLine") {
            e.container.find(".k-filter-and").hide();
        }
    }
</script>

Please try this and let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Get quickly onboarded and successful with Telerik UI for ASP.NET Core with the dedicated Virtual Classroom technical training, available to all active customers.
0
Aleks
Top achievements
Rank 1
Veteran
answered on 28 Feb 2020, 02:36 AM
That works, thanks.
0
Nikolay
Telerik team
answered on 03 Mar 2020, 11:30 AM

Hello Alex,

I am glad to hear my suggestion helped you moving forward with this inquiry.

This thread will now be closed. Please do not hesitate to contact us back if anything else arises.

Regards,
Nikolay
Progress Telerik

Get quickly onboarded and successful with Telerik UI for ASP.NET Core with the dedicated Virtual Classroom technical training, available to all active customers.
Tags
Grid
Asked by
Aleks
Top achievements
Rank 1
Veteran
Answers by
Nikolay
Telerik team
Aleks
Top achievements
Rank 1
Veteran
Share this question
or