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>()
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.
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.
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 ?
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
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.
Kind regards,
David
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
And not
When the drop down is displayed.
I have a grid defined as thus:
@(Html.Kendo().Grid<SubServiceViewModel>()
.Name("SubServiceGrid")
.Columns(columns =>
{
columns.Bound(c => c.Id).Hidden(true);
columns.Bound(c => c.Service)
.ClientTemplate("#=Service.Value#")
.Filterable(false)
.Sortable(false);
columns.Bound(c => c.Value);
columns.Bound(c => c.Active).Hidden(true);
columns.Bound(c => c.Deleted).Hidden(true);
columns.Command(c => c.Destroy());
})
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Save();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable(pager => pager.Refresh(true))
.Sortable()
.Filterable()
.NoRecords()
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(10)
.ServerOperation(true)
.Events(events => events.Error("error_handler").RequestEnd("onRequestEnd('staticNotifications')"))
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.Service).DefaultValue(ViewData["defaultService"] as ServiceViewModel);
model.Field(p => p.Value);
model.Field(p => p.Active).DefaultValue(EntityLiterals.Yes);
model.Field(p => p.Deleted).DefaultValue(EntityLiterals.No);
})
.Read(read => read.Action("GetSubServices", "SubService").Data("forgeryToken"))
.Create(create => create.Action("CreateSubServices", "SubService").Data("forgeryToken"))
.Update(update => update.Action("UpdateSubServices", "SubService").Data("forgeryToken"))
.Destroy(destroy => destroy.Action("DeleteSubServices", "SubService").Data("forgeryToken"))
))
And if I remove the
.Filterable(true)
I get a JS error when I click the column filter button
Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at C (kendo.all.js:318535:21)
at init._createForm (kendo.all.js:318535:21)
at init._init (kendo.all.js:318535:21)
at init._click (kendo.all.js:318535:21)
at HTMLAnchorElement.dispatch (jquery.min.js?v=oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl-cbzUq8:2:43184)
at y.handle (jquery.min.js?v=oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl-cbzUq8:2:41168)
C @ kendo.all.js:318535
_createForm @ kendo.all.js:318535
_init @ kendo.all.js:318535
_click @ kendo.all.js:318535
dispatch @ jquery.min.js?v=oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl-cbzUq8:2
y.handle @ jquery.min.js?v=oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl-cbzUq8:2
Hi
We are having a grid with editable field option which triggers when you click on the field.
I wanted to enable tab functionality so that if you are on any field and click tab it should make the next field enable/editable.
When I am clicking on any field to show like this. On tab press I wanted make Charlotte editable.
ANY help appreciated. Thanks!