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

ComboBox Loading Issue?

2 Answers 77 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
MGrassman
Top achievements
Rank 2
MGrassman asked on 06 Oct 2010, 06:28 AM
I have the following ComboBox

<%: Html.Telerik().ComboBoxFor(model => model.Merchant.AccessTypeId)
     .DataBinding(binding => binding.Ajax().Select("_GetDetailOptionSalesRepAccessList", "OptionDetails", new { area = "Admin", id = Model.Merchant.AccessTypeId }))              
                                        %>
     

Everything loads fine when I click on the combobox and the selected index is correct and show up highlighted.

My problem is I need this to load when the page loads not when the user clicks on it so that the user can see what is selected.

I have also tried to set the .AutoFill(true) this doesn't change anything.  My code still hits the break point at _GetDetailOptionSalesRepAccessList when I click the list and not when the page is loaded.

What am I missing.

I'm using the 2010.2.930 version of the controls.

Thanks

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 06 Oct 2010, 08:25 AM
Hello MGrassman,

In order to achieve your goal you need to wire the OnLoad event handler and bind the combobox UI component in it:
[View]:
<%: Html.Telerik().ComboBoxFor(model => model.Merchant.AccessTypeId)
        .ClientEvents(e => e.OnLoad("onLoad"))
%>

[JavaScript]:
function onLoad(){
  $(this).data('tComboBox').fill();
}

At a side note, .AutoFill(...) method will turn on the combobox ability to give suggestions for the typed text.

Kind regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Kevin Burandt
Top achievements
Rank 1
answered on 27 Mar 2011, 05:22 PM
Very helpful post.  This simple tip should be in the documentation.

Kevin
Tags
ComboBox
Asked by
MGrassman
Top achievements
Rank 2
Answers by
Georgi Krustev
Telerik team
Kevin Burandt
Top achievements
Rank 1
Share this question
or