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

How to Bind Dynamically columns in Filter Component

2 Answers 335 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Asad
Top achievements
Rank 1
Veteran
Asad asked on 20 Aug 2020, 01:40 PM

Hello Admin, 

I am using Kendo Filter Component in .net core 3.1

We have many rows in table and showing all names in filter dropdown but i could not bind dynamically data in filter area.

Please review my all attached files. And let me know how can i bind dynamically data in filter component.

 

Thanks,

 

2 Answers, 1 is accepted

Sort by
0
Asad
Top achievements
Rank 1
Veteran
answered on 20 Aug 2020, 02:38 PM
and also please let me know how to get all selected filter values on server
0
Nikolay
Telerik team
answered on 24 Aug 2020, 02:04 PM

Hello Asa,

Binding the fields DropDownList to a dynamic data is not coming out of the box. However, I could suggest updating the DropDownList data in the change event handler of the Filter, for instance:

change: function (e) {
          var dropdown = $("select[data-bind='value: field']").getKendoDropDownList();
          dropdown.dataSource.data(data2); // data 2 is the new data array
        }
   ...
var data2 = [
        { text: "name", value: "name", type: "string" },
        { text: "age", value:"age", type: "number" },
        { text: "city", value:"city", type: "string" }
      ]

Please refer to the following Dojo for a live demo:

Let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
General Discussions
Asked by
Asad
Top achievements
Rank 1
Veteran
Answers by
Asad
Top achievements
Rank 1
Veteran
Nikolay
Telerik team
Share this question
or