📄 defaultcs.aspx
字号:
<%@ Page Language="c#" AutoEventWireup="false" Codebehind="DefaultCS.aspx.cs" Inherits="Telerik.GridExamplesCSharp.Programming.WebMail.DefaultCS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" Assembly="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
<%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
<%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
<%@ Register TagPrefix="radG" Namespace="Telerik.WebControls" Assembly="RadGrid" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<telerik:HeadTag runat="server" ID="Headtag1" Title="ASP .NET Grid Component: Ajax Datagrid Rad Grid Control"></telerik:HeadTag>
<!-- custom head section -->
<link href="../../Styles/ColorSchemes/Outlook/Styles.css" rel="stylesheet" type="text/css" />
<link href="Styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="WebMail.js"></script>
<!-- end of custom head section -->
</head>
<body class="BODY">
<form runat="server" id="mainForm" method="post" style="width:100%;">
<telerik:Header runat="server" ID="Header1" NavigationLanguage="CS"></telerik:Header>
<!-- content start -->
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="height:320px" class="text">
<tbody>
<tr>
<td valign="top" align="left" style="height:20px">
<span>r.a.d.<b>grid</b> as a Treeview </span>
</td>
<td></td>
<td valign="top" align="left" style="height:20px">
<span>r.a.d.<b>grid</b> with <b>Outlook</b> style </span>
</td>
</tr>
<tr>
<td valign="top" class="OutlookTopBar" style="width:180px;">
All Mail Folders
<radg:radgrid id="FoldersTree" EnableAJAX="True" Width="180px" runat="server" AutoGenerateColumns="False" GridLines="None" CssClass="TreeviewGrid">
<GroupPanel Visible="False"></GroupPanel>
<MasterTableView HierarchyLoadMode="ServerBind" DataMember="Folders" ShowHeader="False">
<Columns>
<radg:GridTemplateColumn>
<ItemTemplate>
<asp:Image BorderWidth="0px" ImageUrl='<%# "Img/" + DataBinder.Eval(Container.DataItem, "FolderName") + ".gif" %>' AlternateText='<%#DataBinder.Eval(Container.DataItem, "FolderName")%>' runat="server" />
</ItemTemplate>
</radg:GridTemplateColumn>
<radg:GridBoundColumn DataField="FolderName"></radg:GridBoundColumn>
</Columns>
<DetailTables>
<radg:GridTableView DataMember="SubFolders" ShowHeader="False">
<Columns>
<radg:GridTemplateColumn>
<ItemTemplate>
<asp:Image BorderWidth="0px" ImageUrl='<%# "Img/" + DataBinder.Eval(Container.DataItem, "FolderName") + ".gif" %>' AlternateText='<%#DataBinder.Eval(Container.DataItem, "FolderName")%>' runat="server" />
</ItemTemplate>
<HeaderStyle Width="20px"></HeaderStyle>
</radg:GridTemplateColumn>
<radg:GridButtonColumn ButtonType="LinkButton" CommandName="Select" DataTextField="FolderName"></radg:GridButtonColumn>
</Columns>
</radg:GridTableView>
</DetailTables>
</MasterTableView>
<GroupHeaderItemStyle BorderColor="Black" BackColor="Silver"></GroupHeaderItemStyle>
<SelectedItemStyle CssClass="SelectedFolder"></SelectedItemStyle>
<ClientSettings><ClientEvents OnRequestEnd="TreeRequestEnd" /></ClientSettings>
</radg:radgrid>
</td>
<td style="BORDER-RIGHT: #002d96 1px solid; background-color=#c4dafa;"> </td>
<td valign="top">
<radg:radgrid id="RadGrid1" EnableAJAX="True" EnableAJAXLoadingTemplate="True" CssClass="RadGrid" runat="server" Width="550px" PageSize="20" AllowSorting="True" AllowMultiRowSelection="True" AllowPaging="True" ShowGroupPanel="True" GridLines="Horizontal" AutoGenerateColumns="False">
<PagerStyle Height="22px" CssClass="GridPager" Mode="NumericPages"></PagerStyle>
<ItemStyle CssClass="GridRow"></ItemStyle>
<AlternatingItemStyle CssClass="GrtidRow"></AlternatingItemStyle>
<GroupHeaderItemStyle Font-Bold="True" Height="35px" ForeColor="#3366CC" CssClass="GroupHeaderItem" VerticalAlign="Bottom"></GroupHeaderItemStyle>
<HeaderStyle HorizontalAlign="left" Height="22px" CssClass="GridHeader"></HeaderStyle>
<GroupPanel>
<PanelItemsStyle CssClass="PanelItemsStyle"></PanelItemsStyle>
<PanelStyle CellSpacing="0" CellPadding="0" Height="22px" CssClass="PanelStyle"></PanelStyle>
</GroupPanel>
<MasterTableView CssClass="MasterTable" DataMember="Mails" AllowMultiColumnSorting="True">
<RowIndicatorColumn UniqueName="RowIndicator">
<HeaderStyle Width="20px" CssClass="ResizeHeader"></HeaderStyle>
</RowIndicatorColumn>
<GroupByExpressions>
<radg:GridGroupByExpression>
<SelectFields>
<radg:GridGroupByField FieldAlias="Received" FieldName="Received"></radg:GridGroupByField>
</SelectFields>
<GroupByFields>
<radg:GridGroupByField FieldAlias="Received" SortOrder="Descending" FieldName="Received"></radg:GridGroupByField>
</GroupByFields>
</radg:GridGroupByExpression>
</GroupByExpressions>
<NoRecordsTemplate>
<table>
<tr>
<td valign="middle" style="padding-left:120px;text-align:center;height:285px">
<asp:Label ForeColor="RoyalBlue" Runat="server" ID="Label1">The are no email items currently in this folder</asp:Label>
<br />
<a href="javascript:GoToInbox();">Go to Inbox</a>
</td>
</tr>
</table>
</NoRecordsTemplate>
<Columns>
<radg:GridTemplateColumn Groupable="False" Reorderable="False" UniqueName="TemplateColumn">
<HeaderStyle Width="20px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" VerticalAlign="top"></ItemStyle>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" AutoPostBack="False" Runat="server"></asp:CheckBox>
</ItemTemplate>
</radg:GridTemplateColumn>
<radg:GridTemplateColumn UniqueName="TemplateColumn1" Groupable="False">
<HeaderStyle Width="20px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Height="36px" VerticalAlign="top"></ItemStyle>
<ItemTemplate>
<img src="img/MailIcon.gif" style="margin-top:4px;margin-left:3px" alt="MailIcon" />
</ItemTemplate>
</radg:GridTemplateColumn>
<radg:GridTemplateColumn UniqueName="TemplateColumn2" GroupByExpression="From Group By From">
<HeaderStyle Width="250px"></HeaderStyle>
<ItemStyle Height="36px"></ItemStyle>
<HeaderTemplate>
<span>From / Subject</span>
</HeaderTemplate>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "From") %>
<br />
<div style="color:#808080">
<%# DataBinder.Eval(Container.DataItem, "Subject") %>
</div>
</ItemTemplate>
</radg:GridTemplateColumn>
<radg:GridBoundColumn UniqueName="Received" SortExpression="Received" HeaderText="Received" DataField="Received">
<HeaderStyle Width="125px"></HeaderStyle>
</radg:GridBoundColumn>
<radg:GridBoundColumn UniqueName="Size" SortExpression="Size" HeaderText="Size" DataField="Size">
<HeaderStyle Width="35px"></HeaderStyle>
</radg:GridBoundColumn>
<radg:GridTemplateColumn UniqueName="TemplateColumn3" Groupable="False">
<HeaderStyle Width="20px"></HeaderStyle>
<ItemStyle HorizontalAlign="Right" Height="36px"></ItemStyle>
<ItemTemplate>
<img src="img/MailFlag.gif" alt="MailFlag" runat="server" ID="Img1" />
</ItemTemplate>
</radg:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
<Selecting AllowRowSelect="True"></Selecting>
<ClientEvents OnRowDeselected="RowDeselected" OnRowSelected="RowSelected" OnRowCreated="RowCreated" OnRowContextMenu="RowContextMenu"></ClientEvents>
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"></Scrolling>
<Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" ClipCellContentOnResize="True" AllowColumnResize="True"></Resizing>
</ClientSettings>
<AJAXLoadingTemplate>
<table>
<tr>
<td valign="middle" style="height:350px">
<img src="~/RadControls/Grid/Skins/Default/Loading.gif" alt="loading" runat="server"/>
</td>
</tr>
</table>
</AJAXLoadingTemplate>
</radg:radgrid>
</td>
</tr>
<tr>
<td colspan="3" align="right" style="padding:5px">
<asp:Button Text="PostBack" Runat="server" id="Button1" CssClass="button"></asp:Button>
</td>
</tr>
</tbody>
</table>
<br/>
<!-- content end -->
<telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -