Page Language CodeFile DefaultCS aspx cs Inherits Telerik GridExamples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.GridExamplesCSharp.Hierarchy.NestedViewTemplate.DefaultCS" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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 id="Head1" runat="server">
<title>News - MainPage</title>
<!-- custom head section -->
<style type="text/css">
body {
font-family: ariel;
font-size: 12px;
background-image: url('images/bggradient.jpg');
background-repeat: repeat-x;
margin: auto;
color: gray;
vertical-align: middle;
}
#logo
{
float:left;
width: 100px;
height: 50px;
}
#welcome
{
float:right;
width: 100px;
height: 50px;
}
#logout
{
float:right;
width: 100px;
height: 50px;
}
.viewWrap
{
padding: 15px;
background: #2291b5 0 0 url(Images/bggradient.jpg) repeat-x;
}
.contactWrap
{
padding: 10px 15px 15px 15px;
background: #fff;
color: #333;
}
.contactWrap td
{
padding: 0 20px 0 0;
}
.contactWrap td td
{
padding: 3px 20px 3px 0;
}
.contactWrap img
{
border: 1px solid #05679d;
}
</style>
<!-- end of custom head section -->
</head>
<body class="BODY">
<form runat="server" id="mainForm" method="post" style="width: 100%;">
<telerik:RadScriptManager runat="server" ID="ScriptManager1">
</telerik:RadScriptManager>
<!-- content start -->
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<div class="bigModule">
<%--<div class="bigModuleBottom">--%>
<div class="logo">
<img src="Images/logo.jpg" alt="NewsApp" />
</div>
<div class="welcome">
<asp:Label runat="server" ID="WelcomeLabel"></asp:Label>
</div>
<div class="logout">
<asp:Button runat="server" ID="LogoutLabel" Text="[Logout]" OnClick="Logout"></asp:Button>
</div>
<%-- </div>--%>
</div>
<telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" DataSourceID="SqlDataSource1"
runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
AllowPaging="True" PageSize="5" GridLines="None" ShowGroupPanel="true" OnItemCreated="RadGrid1_ItemCreated"
OnItemCommand="RadGrid1_ItemCommand" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"
AllowAutomaticDeletes="true">
<PagerStyle Mode="NumericPages"></PagerStyle>
<MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="ID" AllowMultiColumnSorting="True"
GroupLoadMode="Server">
<NestedViewTemplate>
<asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
<telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">
<Tabs>
<telerik:RadTab runat="server" Text="Edit" PageViewID="PageView1">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Author info" PageViewID="PageView2">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Statistics Chart" PageViewID="PageView3">
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Remove" PageViewID="PageView4">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
<telerik:RadPageView runat="server" ID="PageView1">
<asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("Text") %>'
Visible="false" runat="server" />
<telerik:RadEditor runat="server" ID="RadEditor1" SkinID="DefaultSetOfTools" Height="515"
Content='<%# Eval("Text") %>'>
</telerik:RadEditor>
<asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:NewsConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT Text Where ID = @ID"
runat="server">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="EmployeeID" />
</SelectParameters>
</asp:SqlDataSource>
</telerik:RadPageView>
<telerik:RadPageView runat="server" ID="PageView2" Width="460px">
<div class="contactWrap">
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<img src='<%# Page.ResolveUrl("~/Grid/Examples/Hierarchy/NestedViewTemplate/Img/") + (Container.FindControl("Label1") as Label).Text %>.jpg'
alt="Author Image" />
</td>
<td>
<asp:DetailsView ID="DetailsView1" AllowPaging="true" GridLines="None" Width="100%"
DataSourceID="SqlDataSource4" runat="server" Font-Italic="true" AutoGenerateRows="false">
<Fields>
<asp:BoundField HeaderText="Login:" DataField="Login" HeaderStyle-Font-Italic="false"
HeaderStyle-Font-Bold="true" />
<asp:BoundField HeaderText="Name:" DataField="FirstName" HeaderStyle-Font-Italic="false"
HeaderStyle-Font-Bold="true" />
<asp:BoundField HeaderText="Surname:" DataField="Surname" HeaderStyle-Font-Italic="false"
HeaderStyle-Font-Bold="true" />
<asp:BoundField HeaderText="Email:" DataField="Email" HeaderStyle-Font-Italic="false"
HeaderStyle-Font-Bold="true" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource4" ConnectionString="<%$ ConnectionStrings:NewsConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT Login, FirstName, Surname, Email FROM authors inner join news on news.Author_ID = authors.ID"
runat="server">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="EmployeeID" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</div>
</telerik:RadPageView>
<%-- <telerik:RadPageView runat="server" ID="RadPageView3">
<telerik:RadChart ID="RadChart1" DataSourceID="SqlDataSource5" runat="server"
OnItemDataBound="RadChart1_ItemDataBound" Width="465px" Height="260px" DefaultType="Pie"
AutoLayout="true" AutoTextWrap="true" CreateImageMap="false">
<ChartTitle>
<TextBlock Text="Order Total">
</TextBlock>
</ChartTitle>
<Series>
<telerik:ChartSeries DataYColumn="spentMoney" Name="spentMoney" Type="Pie">
<Appearance LegendDisplayMode="ItemLabels">
</Appearance>
</telerik:ChartSeries>
</Series>
</telerik:RadChart>
<asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT TOP 10 p.productId, p.ProductName as pName, sum(od.UnitPrice*od.Quantity) AS spentMoney, c.EmployeeID as cID, c.FirstName as cName&#13;&#10;FROM products as p, orders as o, [order details] as od, employees as c&#13;&#10;WHERE p.productID = od.productID &#13;&#10;and od.OrderID = o.OrderID&#13;&#10;and c.EmployeeID = o.EmployeeID&#13;&#10;and (c.EmployeeID = @EmployeeID)&#13;&#10;GROUP BY c.EmployeeID, c.FirstName, p.productID, p.ProductName, od.UnitPrice">
<SelectParameters>
<asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="EmployeeID" />
</SelectParameters>
</asp:SqlDataSource>
</telerik:RadPageView>--%>
</telerik:RadMultiPage>
</asp:Panel>
</NestedViewTemplate>
<Columns>
<telerik:GridBoundColumn SortExpression="Category" HeaderText="Category" HeaderButtonType="TextButton"
DataField="Name" UniqueName="Category">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Title" HeaderText="Title" HeaderButtonType="TextButton"
DataField="Title" UniqueName="Title">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Date" HeaderText="Date" HeaderButtonType="TextButton"
DataField="Date" UniqueName="Content">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Login" HeaderText="Author" HeaderButtonType="TextButton"
DataField="Login" UniqueName="Author">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings AllowDragToGroup="false" />
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NewsConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM (news INNER JOIN authors on news.Author_ID = authors.ID) INNER JOIN categories on news.Category_ID = categories.ID"
runat="server"></asp:SqlDataSource>
<!-- content end -->
</form>
</body>
</html>