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

Cascading trouble

3 Answers 17 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 14 Jun 2018, 10:29 PM
I'm having a lot of difficulty getting the cascading comboboxes functionality to work. These work as expected when they are independent, but the Child box remains disabled when set up as a cascade (uncommenting the CascadeFrom line). Any help would be appreciated!
 
@(Html.Kendo().ComboBox()
             .Name("Parent")
             .DataTextField("Text")
             .DataValueField("Value")
             .DataSource(source =>
             {
                 source.Read(read =>
                 {
                     read.Action("Cascading_Get_Parents", "Home");
                 })
                     .ServerFiltering(true);
             })
)
 
@(Html.Kendo().ComboBox()
                  .Name("Child")
                  .DataTextField("Text")
                  .DataValueField("Value")
                  //.CascadeFrom("Parent")
                  .DataSource(source =>
                  {
                      source.Read(read =>
                      {
                          read.Action("Cascading_Get_Children", "Home");
                      })
                      .ServerFiltering(true);
                  })
)

3 Answers, 1 is accepted

Sort by
0
Accepted
Neli
Telerik team
answered on 18 Jun 2018, 11:30 AM
Hi Michael,

When serverfiltering is enabled, the filtering of the data depends on the implementation of the remote service.
In order to retrieve only the child items according to the selected parent, you will need to send the data about the selected parent to the server. You could use the transport.read.data, which allows you to send additional parameters to the server. 
Here is a Demo which shows the cascading functionality in ASP.Net MVC projects.
I have prepared also a sample project where the ComboBox cascading functionality is demonstrated. Note, that dependencies are deleted due to the size limits.
I hope this will help.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Michael
Top achievements
Rank 1
answered on 20 Jun 2018, 07:35 PM

Thank you for the help Neli!

Are there any examples of cascading comboboxes with serverfiltering disabled?

Thanks,

Michael

0
Neli
Telerik team
answered on 22 Jun 2018, 12:55 PM
Hello Michael,

When serverfiltering is not explicitly enabled, the filtering will be performed client-side.
Attached you will find the modified sample project. In the Index.cshtml I have commented the unnecessary configurations.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ComboBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Neli
Telerik team
Michael
Top achievements
Rank 1
Share this question
or