<%@ Page Language="c#" AutoEventWireup="false" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.GridExamplesCSharp.Programming.FilteringTemplateColumns.DefaultCS" %>

<%@ Register TagPrefix="custom" Namespace="Telerik.GridExamplesCS.Programming.FilteringTemplateColumns" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!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">
   
</head>
<body >
    <form id="mainForm" method="post" runat="server">
        
     <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
       
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" Width="97%" AllowFilteringByColumn="True"
            AllowSorting="True" PageSize="12" ShowFooter="True" AllowPaging="True" runat="server"
            AutoGenerateColumns="False" GridLines="None" ShowStatusBar="true">
              <GroupingSettings CaseSensitive="false" />
            <MasterTableView EditMode="InPlace" AllowFilteringByColumn="True" ShowFooter="True"
                DataKeyNames="CustomerID" TableLayout="Auto">
                <Columns>
                    <telerik:GridBoundColumn DataField="ContactName" HeaderText="Contact name">
                        <HeaderStyle Width="25%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ContactTitle" HeaderText="Contact title"
                     AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
                        <HeaderStyle Width="25%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="City" HeaderText="TemplateColumn City">
                        <HeaderStyle Width="25%" />
                        <ItemTemplate>
                            <%# Eval("City") %>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <custom:MyCustomFilteringColumn DataField="Country" FilterControlWidth="180px" HeaderText="Custom TemplateColumn Country">
                        <headerstyle width="25%" />
                        <itemtemplate>
							  <img src='Img/<%# Eval("Country") %>.gif' alt="" style="vertical-align:middle;margin-right:7px;"/><%# Eval("Country") %>
						</itemtemplate>
                    </custom:MyCustomFilteringColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT CustomerID, ContactName, ContactTitle, Country, City FROM Customers"
            runat="server"></asp:SqlDataSource>
      
    </form>
</body>
</html>
