1 <%@ Page Language="C#" MasterPageFile="~/MasterPages/SamplePageWithCode.master"
2 AutoEventWireup="true" CodeFile="02_GridViewGroupedSorting.aspx.cs"
3 Inherits="_05_OtherSamples_02_GridViewGroupedSorting"
4 Title="GridView Grouped Sort" %>
5 <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
6 <asp:TextBox ID="CustomerSearch" runat="server"></asp:TextBox>
7 <asp:button ID="SearchButton" runat="server" Text="Search" />
8 <atlas:AutoCompleteExtender ID="AutoComplete" runat="server">
9 <atlas:AutoCompleteProperties Enabled="true"
10 ServiceMethod="GetCustomerAbbr"
11 ServicePath="~/CustomerService.asmx"
12 TargetControlID="CustomerSearch" />
13 </atlas:AutoCompleteExtender>
14 <br />
15 Showing how a GridView with custom rendering code on the codefile can still leverage
16 a simple UpdatePanel without any effort!<br />
17 <br />
18 <atlas:UpdatePanel ID="UpdateGrid" runat="server" Mode="conditional">
19 <ContentTemplate>
20 <asp:GridView ID="GridView1" runat="server" AllowSorting="True" DataSourceID="NWindDb" AutoGenerateColumns="False" OnSorting="GridView1_Sorting">
21 <Columns>
22 <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
23 <asp:BoundField DataField="Region" HeaderText="State" SortExpression="Region" />
24 <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
25 <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" />
26 <asp:BoundField DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName" />
27 </Columns>
28 </asp:GridView>
29 </ContentTemplate>
30 </atlas:UpdatePanel>
31 <asp:SqlDataSource ID="NWindDb" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindDb %>"
32 SelectCommand="SELECT [CompanyName], [ContactName], [Country], [Region], [City] FROM [Customers] WHERE [Country] = 'USA' ORDER BY [CompanyName], [ContactName]">
33 </asp:SqlDataSource>
34 <br />
35 Adapted from <a href="http://aspadvice.com/blogs/joteke/archive/2006/02/11/15130.aspx">joteke's blog post</a>.
36 <br />
37 </asp:Content>
|