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

<!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></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <script type="text/javascript">
            function OnClientDropDownOpened(sender, args) {
                setTimeout(function () {
                    for (var i = 0; i < sender._dropDown._items.length; i++) {
                        $telerik.$(sender._dropDown._items[i]._element).show();
                    }
                }, 0);
            }

            function OnClientClicked(sender, args) {
                var autocompletebox = $find("<%= RadAutoCompleteBox1.ClientID%>");
                autocompletebox._dropDown.open(autocompletebox._getDropDownPositionInfo());
            }
        </script>
        <telerik:RadButton runat="server" AutoPostBack="false" OnClientClicked="OnClientClicked" Text="Show all" />
        <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1" EnableClientFiltering="True" OnClientDropDownOpened="OnClientDropDownOpened"
            InputType="Token" DropDownHeight="400px" Width="100%"
            DataValueField="ProductID" DataTextField="ProductName" DataSourceID="SqlDataSource1" AllowCustomEntry="true">
        </telerik:RadAutoCompleteBox>


        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="SELECT [ProductID], [ProductName] FROM [Alphabetical list of products]"></asp:SqlDataSource>
    </form>
</body>
</html>
