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

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        &nbsp;<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="MyGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="MyGrid" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadCodeBlock runat="server" ID="radCodeBlock">

            <script type="text/javascript">
                function showFilterItem()
                {
                    $find('<%=MyGrid.ClientID %>').get_masterTableView().showFilterItem();
                } 
                
            </script>

        </telerik:RadCodeBlock>
        <div>
            Show filtering item
            <input id="Radio1" type="radio" runat="server" name="showHideGroup" onclick="showFilterItem()" /><label
                for="Radio1">Yes</label>
        </div>
        <telerik:RadGrid runat="server" ID="MyGrid" Skin="Office2007" BorderStyle="Solid"
            ShowGroupPanel="true" BorderWidth="1px" AutoGenerateColumns="False" AllowMultiRowSelection="True"
            Width="810px" AllowPaging="True" AllowFilteringByColumn="true" DataSourceID="AccessDataSource1"
            GridLines="None" AllowSorting="True" Height="289px"
            >
            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
            <MasterTableView TableLayout="Fixed" ShowFooter="True" AllowFilteringByColumn="True"
                DataSourceID="AccessDataSource1" CellSpacing="-1">
                <Columns>
                    <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" UniqueName="ProductName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" HeaderText="UnitPrice"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" SortExpression="UnitPrice"
                        UniqueName="UnitPrice">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CategoryName" AutoPostBackOnFilter="true" HeaderText="CategoryName"
                        SortExpression="CategoryName"  CurrentFilterFunction="Contains" UniqueName="CategoryName" >
                        <HeaderStyle Width="33%" />
                        <ItemStyle Width="33%" />
                        <FilterTemplate>
                            <telerik:RadComboBox runat="server" ID="cbClickActivityReconciledFlags"  AutoPostBack="true"
                            OnSelectedIndexChanged="CickActivityFilterType_SelectedIndexChanged"
                                Skin="Hay">
                                <Items>
                                    <telerik:RadComboBoxItem Text="All" Value="All" />
                                    <telerik:RadComboBoxItem Text="Produce" Value="Produce" />
                                    <telerik:RadComboBoxItem Text="test" Value="test" />
                                    <telerik:RadComboBoxItem Text="Dairy Products" Value="Dairy Products" />
                                </Items>
                            </telerik:RadComboBox>
                            
                        </FilterTemplate>
                    </telerik:GridBoundColumn>
                </Columns>
                <HeaderStyle HorizontalAlign="Center" />
                <AlternatingItemStyle BackColor="#FFFFCC" BorderColor="#CC3300" BorderStyle="Solid"
                    BorderWidth="1px" Wrap="False" CssClass="lista" Height="20px" />
                <PagerStyle AlwaysVisible="True" NextPagesToolTip="Avanti" NextPageToolTip="Avanti"
                    PagerTextFormat="Cambio Pagina: {4} &amp;nbsp;Pagina {0} di {1}, Totale record: {5}."
                    PrevPagesToolTip="Indietro" PrevPageToolTip="Indietro" />
            </MasterTableView>
            <GroupPanel Visible="True">
            </GroupPanel>
            <ClientSettings AllowDragToGroup="True" ColumnsReorderMethod="Reorder">
                <Scrolling AllowScroll="True" />
            </ClientSettings>
        </telerik:RadGrid>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb"
            SelectCommand="SELECT [ProductName], [UnitPrice], [CategoryName] FROM [Alphabetical List of Products]">
        </asp:AccessDataSource>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </form>
</body>
</html>
