Telerik Forums
UI for ASP.NET Core Forum
1 answer
40 views

I'm currently redesigning the filter menus in our MVC ASP.NET Core project. As of now, they all have the default menu:

I would like to customise the menus according to the columns' data types - have date range pickers for dates, a slider from min to max value for numbers, etc. The main point is to make the process simpler - so the users only need to input a few characters/choose a date/slide to the right number, instead of filling out this complicated configuration.

Some of such components are provided by kendo (e.g. DateRangePicker), others aren't (e.g. the above-mentioned slider; at least I didn't find anything like it), but could be implemented with a custom function. Either way, I can't seem to be able to override the default filter menu.

The only promising suggesstion on how to achieve something like this that I found was:

grid.Columns(c => c.Bound(item.Name)
       .Filterable(ftb => ftb.UI("datePickerFilter"))
function datePickerFilter(element) {
    element.kendoDateRangePicker({
        messages: {
            startLabel: "Check-In",
            endLabel: "Check-Out"
        },
        format: "MM/dd/yyyy"
    });
}
Unfortunately, it did not work. So any help, advice or personal experience with a similar issue will be very much appreciated :) Thanks.
Anton Mironov
Telerik team
 answered on 03 Apr 2025
1 answer
76 views

Hi, I'm using UI ASP.Net core to display some data on a grid. On one of the grid column I need a filter with multi-checkbox and search. I'm doing this by the following code on the view:

columns.Bound(c => c.Affects).Title("Components").ClientTemplate("#=showComponents(data)#").Groupable(false).Width(180).Hidden(true)
    .Filterable(fb => fb.Multi(true).CheckAll(true).Search(true).ItemTemplate("filterComponentsTemplate")
        .DataSource(ds => ds.Read(r => r.Action("GetComponentsNamesForGridFilter", "Changes"))));

My problem is than the list of components is very very big and I get performance issue on the initial load of the filter menu. I would like to limit the number of components to be displayed to 100 and refresh the list every time a key is pressed on the Search textbox.

How to do that? I cannot find a way to handle events from the filter search textbox.

Ivaylo
Telerik team
 answered on 01 Nov 2024
1 answer
117 views

Hi, I have this Grid which uses Custom Binding for manual skip and take on the server.

After successful Read of data, my problem now is the Search and Filtering feature is now working.

 

 

@(Html.Kendo().Grid<MyWebApp.Web.Models.ViewModel>()
        .Name("grid")
        .EnableCustomBinding(true)
        .Columns(columns =>
        {
            columns.Bound(p => p.Sorting).Width(100).Filterable(false);
            columns.Bound(p => p.Code).Width(200).Filterable(true);
            columns.Bound(p => p.Description).Filterable(true);
        })
        .ToolBar(toolbar =>
        {
            toolbar.Search();
        })
        .Filterable()
        .Pageable()
        .Sortable()
        .Scrollable(scr => scr.Height(550))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Events(events => events.Error("error_handler"))
            .Model(model => model.Id(p => p.Id))
            .Read("gridDataSource", "Home")
        )
)
Alexander
Telerik team
 answered on 26 Dec 2023
1 answer
154 views

Hi,

I tried to set up a DataSource and a Filter Control like in the demo (https://demos.telerik.com/aspnet-core/filter) but i can not get the DataSource working.

I have the kendo v2023.3.1010 JS Files (kendo.all.min.js, kendo.aspnetmvc.min.js) and other controls like buttons, grids, etc all work as expected

My cshtml Page is

[PartialView/_SearchProvision.cshtml]

@using Kendo.Mvc; @using Model; @( Html.Kendo().DataSource<SearchProvisionDto>() .Name("DS_SearchProvision") .Ajax(dataSource => dataSource .Read("GetData", "SearchProvisionDto") ) ) @(Html.Kendo().Filter<SearchProvisionDto>() .Name("Filter_PCProvision") .DataSource("DS_SearchProvision") .MainLogic(FilterCompositionLogicalOperator.Or) .ApplyButton() .ExpressionPreview()

//Fields, FilterExpression }


Loading the Page shows only, that the DataSource is not initialized

 

Am I missing something? I dont really understand where the problem might be.

Felix
Top achievements
Rank 1
Iron
 updated question on 05 Dec 2023
0 answers
74 views
I think heading is enough.
kva
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 29 Sep 2023
1 answer
93 views

I would like to store filter's state in url. The url should be formed by pressing apply button. When the page with url containing filter information is opened, the filter should consume this information and display on the page.

Alexander
Telerik team
 answered on 19 Sep 2023
1 answer
176 views

Hi there,

While working with the Filter Component I was able to export an CompositeFilterDescriptor object on the client side before sending it to the server, the backend is a .net core API.

Unfortunately I tried to use Telerik.Datasource DLL in order to utilize the JSON parsing functionality inside however it seems like they are from two different worlds !

On the Angular side the CompositeFilterDescriptor looks like this 

{
    "logic": "or", 
    "filters": [ 
       {
           "field" : "unitId",
           "operator" : "eq", 
            "value" : "1005"
       }
     ]
}

On the .NET side the CompositeFilterDescriptor it is expecting something like this


{
  "logicalOperator": 1,
  "filterDescriptors": [
      {
        "member": "unitId", 
        "operator": 2 , 
        "value" : "1005"
      }
  ]
}

Summary of Differences

1- Field names are different and hence not parsed properly ( i.e. logicalOperator vs logic, member vs field)

2- Enumerations are sent as strings from Angular but parsed as Integers from Telerik.Datasource 

 

I feel a little bit confused here, is there any library provided by Telerik that I can use to capture the Angular CompositeFilterDescriptor JSON Object received from the client app inside a Web API ?


 

Alexander
Telerik team
 answered on 08 Sep 2023
1 answer
442 views

Hello,

I have an Ajax Kendo grid and would like to apply a filter on load.  There is a date column that I would like to get the max date and use that as the initial filter (not hardcoding the value).  Is this doable and if so how?

Thanks

D

Mihaela
Telerik team
 answered on 21 Jul 2023
0 answers
465 views

Hi,

We have a Kendo Grid bound to a ViewModel with a string value that can be null. If we use NullValueHandling.Include in our MVC project Startup NewtonsoftJson.SerializerSettings:

.AddNewtonsoftJson(o =>
{
    o.SerializerSettings.ContractResolver = new DefaultContractResolver();
    o.SerializerSettings.NullValueHandling = NullValueHandling.Include;
})

this results in the null value being included in the Grid Multi Filter (see attached). If we use NullValueHandling.Ignore, this results in no value being included in the Grid Multi Filter and we can't filter on empty values. This seems odd, as the Grid is bound to a ViewModel which has the property declared on it. In KendoReact Grids, the value is correctly included in the Grid Multi Filter as 'undefined'  when using NullValueHandling.Ignore e.g. https://stackblitz.com/edit/react-ycmafw?file=app%2Fproducts.json.

  1. Is there any way to force the ASP.NET Core Grid to include the property as undefined?
  2. If not, is there any way to add a custom item to the Grid Multi Filter list that will match undefined values?

Kind regards,

David

David
Top achievements
Rank 1
Iron
Iron
Veteran
 asked on 26 Jun 2023
1 answer
646 views

I'm using ASP NET CORE.  I have a grid and I enable filtering on a column with .Filterable().  Is there a way to sort the items that appear in the checkbox filter?

EX:

My filter would look like this

  • A
  • B
  • C

And not

  • B
  • C
  • A

When the drop down is displayed.

Alexander
Telerik team
 answered on 09 Jun 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?