6

I have an ASP.Net MVC Kendo UI combobox that is databound to a table with 1000's of records. I've set the MinLength property to 5 so I only return relevant results. The problem is, the user might need to change the text value all together. Is there a way to tell the control to refresh?

Here's the code for the control...

@(Html.Kendo().ComboBoxFor(x => x.Product)
                    .Name("Product")
                    .DataTextField("Name") // Display value
                    .DataValueField("Id") //Return value
                    .MinLength(5)
                    .AutoBind(false)
                    .Suggest(true)
                    .Filter(FilterType.Contains)
                    .DataSource(source =>
                    {
                        source.Read(read =>
                        {
                            read.Action("Products", "Home").Data("onGetProducts");
                        });
                    })
                )
Andrew Boes
  • 2,013
  • 4
  • 22
  • 29
  • under what circumstance do you want it to refresh? On a timer, or are you feeding it an event that it could hook onto? – Elsimer Mar 20 '13 at 15:03

2 Answers2

14

if I understand what you are struggling with: simply call read action again from where ever you need:

$("#Product").data("kendoComboBox").dataSource.read();
briler
  • 570
  • 6
  • 21
0

I think with wrapper you cannot refresh but the better way for get result is Kendo froum and u can use this question:

As it is stated in the docs, the refresh method of the widget does not reload the data of the DataSource. To reload the data use the read method of the dataSource.

  • that's a good example but I can't figure out how to get the control to call refresh. In this example the user has to manually press refresh. – Andrew Boes Mar 13 '13 at 17:08