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

<%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %>
<%@ Register Assembly="RadToolbar.Net2" Namespace="Telerik.WebControls" TagPrefix="radTlb" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
<!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>

<script type="text/javascript">
//<!--
    function ClientClickHandler(sender, e)
    {
        if (sender.CommandName == "Open")
        {
          var rcbTables = 
          <%
             RadToolbarTemplateButton rttbTables = 
              (RadToolbarTemplateButton)RadToolbar1.Items.TemplatedButtons[0]; 
             RadComboBox rcbTables = (RadComboBox)rttbTables.FindControl("rcbTables"); 
             Response.Write(rcbTables.ClientID);  
          %>
          var tableName = rcbTables.GetText();              
          return window.confirm("Are you sure you want to open " + tableName); 
        }
    }
//-->
</script>

<form id="form1" runat="server">
    <div>
        <radTlb:RadToolbar ID="RadToolbar1" runat="server" OnOnClick="RadToolbar1_OnClick"            
            AutoPostBack="True" Skin="winAmpModern">
            <Items>
                <radTlb:RadToolbarTemplateButton ID="rttbTables" runat="server">
                    <ButtonTemplate>
                        <radC:RadComboBox ID="rcbTables" runat="server" ></radC:RadComboBox>
                    </ButtonTemplate>
                </radTlb:RadToolbarTemplateButton>
                <radTlb:RadToolbarButton ID="RadToolbarButton1" runat="server" 
                    ButtonImage="Open.gif" ButtonText="Open" CommandName="Open" 
                    Hidden="False" 
                    ToolTip="Click this button to open the selected table " />
                <radTlb:RadToolbarSeparator runat="server" />
                <radTlb:RadToolbarTemplateButton ID="rttbFilter" runat="server">
                    <ButtonTemplate>
                        Filter Column:
                        <radC:RadComboBox ID="rcbFilter" runat="server">
                        </radC:RadComboBox>
                        Value:
                        <asp:TextBox ID="tbFilter" runat="server"></asp:TextBox>
                    </ButtonTemplate>
                </radTlb:RadToolbarTemplateButton>
                <radTlb:RadToolbarToggleButton ID="rtbFilter" runat="server" ButtonText="Filter"
                    ToolTip="Filter results" CommandName="Filter" Hidden="False" ButtonImage="Find.gif" />
                <radTlb:RadToolbarSeparator runat="server" />
            </Items>
        </radTlb:RadToolbar>
        <radG:RadGrid ID="RadGrid1" runat="server" GridLines="None"></radG:RadGrid>
    </div>
</form>

<script type="text/javascript">
//<!--
  <%= RadToolbar1.ClientID %>.attachEvent("OnClientClick","ClientClickHandler");        
//-->
</script>

</body>
</html>
