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
<%@ 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>
<style type="text/css">
body
{
font-family: ariel;
font-size: 12px;
background-image: url( 'images/bggradient.jpg' );
background-repeat: repeat-x;
background-color: Black;
margin: auto;
color: gray;
vertical-align: middle;
padding: 50px;
}
#header
{
font-size: xx-large;
}
#datamenu
{
float: left;
}
#logo
{
float: left;
}
#welcome
{
float: right;
padding: 35px;
}
#logout
{
float: right;
padding: 50px;
}
.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;
}
</style>
</head>
<body class="BODY">
<form runat="server" id="mainForm" method="post" style="width: 100%;">
<telerik:RadScriptManager runat="server" ID="ScriptManager1">
</telerik:RadScriptManager>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
<!-- 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="header">
<div id="logo">
<img src="Images/logo.gif" alt="NewsApp" />
</div>
<div id="logout">
<asp:Button runat="server" ID="LogoutLabel" Text="[Logout]" OnClick="Logout"></asp:Button>
</div>
<div id="welcome">
<h1>
<asp:Label runat="server" ID="WelcomeLabel"></asp:Label>
</h1>
</div>
</div>
<div id="maindiv" style="background-color: #FFFFFF;">
<telerik:RadGrid ID="RadGrid1" DataSourceID="NewsDataSource"
runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowPaging="True"
PageSize="5" GridLines="None" ShowGroupPanel="True" OnItemCreated="RadGrid1_ItemCreated"
OnItemCommand="RadGrid1_ItemCommand" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
AllowAutomaticDeletes="True" Skin="Black">
<PagerStyle Mode="NumericPages"></PagerStyle>
<MasterTableView DataSourceID="NewsDataSource" DataKeyNames="ID" AllowMultiColumnSorting="True"
GroupLoadMode="Server" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">
<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
<ItemStyle CssClass="MyImageButton" />
</telerik:GridEditCommandColumn>
<telerik:GridDropDownColumn DataField="Category_ID" DataSourceID="CategoryDataSource"
HeaderText="Category" ListTextField="Name" ListValueField="ID" UniqueName="CategoryID"
ColumnEditorID="GridDropDownColumnEditor1">
</telerik:GridDropDownColumn>
<telerik:GridBoundColumn DataField="Title" HeaderText="Title" SortExpression="Title"
UniqueName="Title">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Text" UniqueName="Text" DataField="Text">
<ItemTemplate>
<asp:Label ID="lblText" runat="server" Text='<%# TrimDescription(Eval("Text") as string) %>' />
</ItemTemplate>
<EditItemTemplate>
<telerik:RadEditor ID="txbText" runat="server"
Content='<%# Bind("Text") %>'>
<Colors></Colors>
</telerik:RadEditor>
</EditItemTemplate>
<ItemStyle VerticalAlign="Top" />
</telerik:GridTemplateColumn>
<telerik:GridDateTimeColumn PickerType="DateTimePicker" DataField="Date" DataType="System.DateTime" HeaderText="Date"
SortExpression="Date" UniqueName="Date">
</telerik:GridDateTimeColumn>
<telerik:GridDropDownColumn DataField="Author_ID" DataSourceID="AuthorDataSource"
HeaderText="Author" ListTextField="Login" ListValueField="ID" UniqueName="AuthorID"
ColumnEditorID="GridDropDownColumnEditor1">
</telerik:GridDropDownColumn>
<telerik:GridTemplateColumn HeaderText="Author e-mail" SortExpression="Author.Email">
<ItemTemplate>
<asp:Label ID="lblMail" runat="server" Text='<%# AppendMailUrlFormat(Eval("Author.Email") as string) %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn ConfirmText="Delete this entry?" ConfirmDialogType="RadWindow"
ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowDragToGroup="false" />
</telerik:RadGrid>
<asp:LinqDataSource ID="NewsDataSource" runat="server" ContextTypeName="NewsApp.NewsDataClassesDataContext"
EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="news">
</asp:LinqDataSource>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="NewsApp.NewsDataClassesDataContext"
EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="news">
</asp:LinqDataSource>
<asp:LinqDataSource ID="CategoryDataSource" runat="server" ContextTypeName="NewsApp.NewsDataClassesDataContext"
EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="categories">
</asp:LinqDataSource>
</asp:LinqDataSource>
<asp:LinqDataSource ID="AuthorDataSource" runat="server" ContextTypeName="NewsApp.NewsDataClassesDataContext"
EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="authors">
</asp:LinqDataSource>
</div>
</form>
</body>
</html>