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

Databinding for RadComBox

1 Answer 68 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 20 Nov 2008, 03:23 PM
Hi,
    I have two RadComboBox controls on my page.  Here is the markup for the combo boxes:
<telerik:RadComboBox OnClientSelectedIndexChanged="LoadLevels" Skin="Vista" ID="ApplicationComboBox" runat="server"/>                    
<telerik:RadComboBox Skin="Vista" ID="LevelComboBox" runat="server"/>        

javascript:
function LoadLevels(item) {
        var levelCombo = $find("<%= LevelComboBox.ClientID %>");
        alert(item.Value);
        levelCombo.RequestItems(item.Value, false);
    }              

server code:
LevelComboBox.ItemsRequested += new RadComboBoxItemsRequestedEventHandler(LevelComboBox_ItemsRequested);

void LevelComboBox_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            LoadLevels(e.Value);
        }

What is supposed to happen is once the user selects an item from the ApplicationComboBox control, the LevelComboBox gets updated/populated with corresponding data.  I think I have followed the live demo pretty well. (http://demos.telerik.com/aspnet/Combobox/Examples/Functionality/MultipleComboBoxes/DefaultCS.aspx)

I am having 2 issues:
1) Javascript throws an error saying "Object doesn't support this property or method".  This gets thrown when I call the RequestItems method in javascript.
2) The item.Value is "undefined";

I have also tried to do this by subscribing to the selectedindexchanged event on the server side to update my second combo box.  This works the first time, but if I select another value then the second combo box will not get updated.

Any help would be greatly appreciated.

Thanks,
Greg

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 20 Nov 2008, 06:12 PM
Hello Greg Case,

This demo is the for the older version of RadComboBox. Please check this instead.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Greg
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or