Telerik Forums
UI for ASP.NET Core Forum
1 answer
25 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
40 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
29 views
I think heading is enough.
kva
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 29 Sep 2023
1 answer
32 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
50 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
148 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
172 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
170 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
1 answer
67 views

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
However, because I'm using InCell editing, I have a ViewData object populated with my DropDown items (with the UI Hint), similar to the demo.  Is there any way around this?
Mike
Top achievements
Rank 1
Iron
 answered on 25 May 2023
1 answer
84 views

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!

Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?