Advertisement
Guest User

Untitled

a guest
Nov 20th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.35 KB | None | 0 0
  1. <%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="MasterDetail.aspx.cs"
  2.    Inherits="MasterDetail_MasterDetail" %>
  3. <asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" runat="Server">
  4.     <dx:ASPxCheckBox ID="chkSingleExpanded" runat="server" Text="Keep a single expanded row at a time"
  5.        AutoPostBack="true" OnCheckedChanged="chkSingleExpanded_CheckedChanged" />
  6.     <br />
  7.     <dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="masterDataSource"
  8.        KeyFieldName="CustomerID" Width="100%">
  9.         <Columns>
  10.             <dx:GridViewDataColumn FieldName="ContactName" VisibleIndex="0" />
  11.             <dx:GridViewDataColumn FieldName="CompanyName" VisibleIndex="1" />
  12.             <dx:GridViewDataColumn FieldName="City" VisibleIndex="2" />
  13.             <dx:GridViewDataColumn FieldName="Country" VisibleIndex="3" />
  14.         </Columns>
  15.         <Templates>
  16.             <DetailRow>
  17.                 Contact Phone: <b>
  18.                     <%# Eval("Phone")%></b>, Fax: <b>
  19.                         <%# Eval("Fax")%></b>
  20.                 <br />
  21.                 <br />
  22.                 <dx:ASPxGridView ID="detailGrid" runat="server" DataSourceID="detailDataSource" KeyFieldName="OrderID"
  23.                    Width="100%" OnBeforePerformDataSelect="detailGrid_DataSelect" OnCustomUnboundColumnData="detailGrid_CustomUnboundColumnData">
  24.                     <Columns>
  25.                         <dx:GridViewDataColumn FieldName="OrderID" Caption="Order Id" VisibleIndex="1" />
  26.                         <dx:GridViewDataColumn FieldName="OrderDate" VisibleIndex="2" />
  27.                         <dx:GridViewDataColumn FieldName="ShipName" VisibleIndex="2" />
  28.                         <dx:GridViewDataColumn FieldName="Quantity" VisibleIndex="5" Name="Quantity" />
  29.                         <dx:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="4">
  30.                             <PropertiesTextEdit DisplayFormatString="c" />
  31.                         </dx:GridViewDataTextColumn>
  32.                         <dx:GridViewDataTextColumn FieldName="Total" VisibleIndex="6" UnboundType="Decimal">
  33.                             <PropertiesTextEdit DisplayFormatString="c" />
  34.                         </dx:GridViewDataTextColumn>
  35.                     </Columns>
  36.                     <Settings ShowFooter="True" />
  37.                     <TotalSummary>
  38.                         <dx:ASPxSummaryItem FieldName="CompanyName" SummaryType="Count" />
  39.                         <dx:ASPxSummaryItem FieldName="Total" SummaryType="Sum" />
  40.                         <dx:ASPxSummaryItem FieldName="Quantity" SummaryType="Sum" />
  41.                     </TotalSummary>
  42.                 </dx:ASPxGridView>
  43.             </DetailRow>
  44.         </Templates>
  45.         <SettingsDetail ShowDetailRow="true" />
  46.     </dx:ASPxGridView>
  47.     <asp:AccessDataSource ID="masterDataSource" runat="server" DataFile="~/App_Data/nwind.mdb"
  48.        SelectCommand="SELECT * FROM [Customers]"></asp:AccessDataSource>
  49.     <asp:AccessDataSource ID="detailDataSource" runat="server" DataFile="~/App_Data/nwind.mdb"
  50.        SelectCommand="SELECT * FROM [Invoices] Where CustomerID = ?">
  51.         <SelectParameters>
  52.             <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="String" />
  53.         </SelectParameters>
  54.     </asp:AccessDataSource>
  55. </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement