<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Cascade._Default" %>

<%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table border=0 cellpadding=5 width=400px>
            <tr>
                <td width=200px align=left>
                    Make<br />
                    <radc:radcombobox id="rcbMake" runat="server" Height=200px
                        OnClientSelectedIndexChanging="LoadModels">
                    </radc:radcombobox>
                </td>
                <td width=200px align=left>
                    Model<br />
                    <radc:radcombobox id="rcbModel" runat="server" Height=200px 
                        onitemsrequested="rcbModel_ItemsRequested"
                        OnClientItemsRequested="ItemsLoaded"></radc:radcombobox>
                </td>
            </tr>
        </table>
 <script type="text/javascript">
    var modelCombo = <%= rcbModel.ClientID %>;    

    function LoadModels(item)
    {    
        modelCombo.SetText("Loading...");
        modelCombo.ClearSelection();
        
        if (item.Index > 0)
        {        
            modelCombo.RequestItems(item.Value, false);                                
        }
    }
 
    function ItemsLoaded(combo)
    {
        if (combo.Items.length > 0)
        {
            combo.SetText(combo.Items[0].Text);
        }
        combo.ShowDropDown();
    }
</script>       
    </div>
    </form>
</body>
</html>
