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

Set initial Data and bind remotely only after Min Length exceeded

1 Answer 121 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 12 Jun 2014, 04:47 PM
Hi,

We have a page with several combobox's and due to the delay from them all AutoBinding the page loads with the numeric value displaying inside the textbox and is only replaced by the text after the bind.  Is there a way to set an initial data binding while still attaching the read method to load server filtered alternatives via Ajax?  This way the page will display the text on load, and avoid multiple simultaneous ajax requests.

For example here is some failed code I've tried to give you some idea of what I would like.

@(Html.Kendo().ComboBoxFor(x => x.List[i].ID)
                            .DataTextField("Name")
                            .DataValueField("ID")
                            .Filter(FilterType.StartsWith)
                            .MinLength(3)
                            .BindTo(new List<ItemDTO>(){
                                new ItemDTO(){
                                    ID = Model.List[i].ID,
                                    Name = Model.List[i].Name
                                }
                            })
                            .AutoBind(false)
                            .DataSource(ds =>
                            {
                                ds.Read(r => r.Action("Action", "Controller").Data("filter")).ServerFiltering(true);
                            })
                            .Events(e => e.Change("Change"))
                    )

Thanks,
Kevin

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 16 Jun 2014, 01:56 PM
Hello Kevin,

You should the text option to set the initial text when the automatic binding is disabled in order to avoid showing the value.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ComboBox
Asked by
Kevin
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or