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

[Solved] Can't set selected value on client side

0 Answers 134 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.
Pete
Top achievements
Rank 1
Pete asked on 21 Dec 2010, 05:54 PM
Here's my client code:

Client: <span class="comboBox">     
                        <%:Html.Telerik().ComboBox()
                                 .Name("ClientComboBox")
                                 .SelectedIndex(0)
                                 .BindTo(new SelectList(Model.ClientComboBox.Data, "Key", "Value"))
                                 .ClientEvents(events => events
                                                             .OnChange("onClientComboBoxChange"))
               %>


and the javascript:

$(function () {
 
if ($('#ClientId').val() > 0) {
        var combobox = $('#ClientComboBox').data('tComboBox');
        
 
        alert(combobox); // IS NULL
        combobox.select($('#ClientId').val());
        }
 
// More code in ready handler

Following the documentation, but combobox variable is null... please advise

Thanks
Pete
Tags
ComboBox
Asked by
Pete
Top achievements
Rank 1
Share this question
or