Having Value in Dropdown list not affect results from Filter Query

Hello there,
I am trying to set up a filter query in dropdownlistt that splits up each word and looks at them  both and if both words exist in results then show those results.
The problem iI think I m running into is the query filters what i want but is still also looking for the value that is in the dropdown box filter.

Example: If I have an item which is TWTH - Extension Course English and I type in the filter box TWTH Extension course it wont show up even though my filter is doing the following: 


public async Task FilterList(FilteringEventArgs args)
    {
        var text = args.Text.Split(" ", StringSplitOptions.TrimEntries);
        string querystring = "";

        var Col1Pre = new WhereFilter();
        var predicate = new List<WhereFilter>();
        args.PreventDefaultAction = true;




        if (text.Count() == 1 || text.Count() == 2 && string.IsNullOrEmpty(text[1]))
        {
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[0], IgnoreCase = true });
        }
        else if (text.Count() == 2 || text.Count() == 3 && string.IsNullOrEmpty(text[2]))
        {
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[0], IgnoreCase = true});
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[1], IgnoreCase = true});
        }
        else if (text.Count() == 3 || text.Count() == 4 && string.IsNullOrEmpty(text[3]))
        {
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[0], IgnoreCase = true});
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[1], IgnoreCase = true});
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[2], IgnoreCase = true}); 
        }
        else if (text.Count() == 4 || text.Count() == 5 && string.IsNullOrEmpty(text[4]))
        {
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[0], IgnoreCase = true});
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[1], IgnoreCase = true});
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[2], IgnoreCase = true});
            predicate.Add(new WhereFilter() { Field = "Description", Operator = "contains", value = text[3], IgnoreCase = true});       
         }

        Col1Pre = WhereFilter.And(predicate);

        Query = new Query().Where(Col1Pre).Take(40).Distinct(Description);

        //await SfComboBox.Filter(ItemsList, Query);
        //Description = data.GetItems().Where(p => EF.Functions.Like(p.Description, "%" + args.Text + "%")).Select(p => p.Description).Distinct().Take(20).ToList();

    }


1 Reply 1 reply marked as answer

JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team March 22, 2021 11:24 AM UTC

Hello Thomas, 

Greetings from Syncfusion support. 

We have checked your query of Dropdownlist not filtering values when filtering the values based on each word. We tried to replicate the issue with the help of the code snippet provided. Unfortunately, we could not replicate the same. Here we attached the ensured sample in the below link. Please share some more additional information about this issue to validate this issue further. 

1. Whether Dropdownlist is rendered with ItemTemplate.
2. Code Snippet of Dropdownlist rendering part and its associated callbacks. 
3. Console errors or exceptions if any. 
4. Syncfusion package version. 
5. If possible, reproduce the reported issue in the attached sample. 


Screenshot:


 
 


Also, while examining the code snippet of Filtering event callback, you have commented out the filter method invocation. We suggest you to ensure by uncomment the filter method invocation part.

Regards, 
Jeyanth. 


Marked as answer
Loader.
Up arrow icon