or
public
class
Name : ITemplate
{
#region ITemplate Members
public
void
InstantiateIn(Control container)
{
// open main container
container.Controls.Add(
new
LiteralControl(
"<div class=\"related-rm-eb-results-gridview-name\">"
));
using
(var nameLiteral =
new
Literal())
{
nameLiteral.ID =
"Name"
;
nameLiteral.DataBinding += NameDataBinding;
container.Controls.Add(nameLiteral);
}
// close main container
container.Controls.Add(
new
LiteralControl(
"</div>"
));
}
#endregion
public
void
NameDataBinding(
object
sender, EventArgs e)
{
using
(var nameLiteral = sender
as
Literal)
{
if
(nameLiteral !=
null
)
{
var item = nameLiteral.NamingContainer
as
GridDataItem;
if
(item !=
null
)
{
var entity = item.DataItem
as
DataContracts.Entity;
if
(entity !=
null
)
nameLiteral.Text = entity.Name;
}
}
}
}
}
<
telerik:RadPanelBar
ID
=
"RadPanelBar1"
Runat
=
"server"
DataFieldID
=
"DataFieldID"
DataFieldParentID
=
"DataFieldParentID"
DataNavigateUrlField
=
"DataNavigateUrlField"
DataSourceID
=
"sds_ITC_MenuConsole"
DataTextField
=
"DataTextField"
DataValueField
=
"DataTextField"
Width
=
"250px"
PersistStateInCookie
=
"True"
Skin
=
"WebBlue"
ExpandMode
=
"MultipleExpandedItems"
>
<
DataBindings
>
<
telerik:RadPanelItemBinding
SelectedImageUrlField
=
"ImageURL"
ExpandedImageUrlField
=
"ImageURL"
HoveredImageUrlField
=
"ImageURL"
ImageUrlField
=
"ImageURL"
/>
<
telerik:RadPanelItemBinding
ImageUrlField
=
"ImageURL"
/>
</
DataBindings
>
</
telerik:RadPanelBar
>
Root | 32 | NULL | Network Operations Center | ~/ITC_Console/noc/noc.aspx |
Child | 33 | 32 | NOC Tools | NULL |
Child Item | 34 | 33 | Server Room Check Log | ~/ITC_Console/noc/server_room_check_log.aspx |
Child Item | 35 | 33 | Master Projects | ~/ITC_Console/noc/master_projects.aspx |
Child Item | 36 | 33 | Projects | ~/ITC_Console/noc/projects.aspx |
Child Item | 37 | 33 | Tasks | ~/ITC_Console/noc/tasks.aspx |
Child Item | 38 | 33 | Parts on Order | ~/ITC_Console/noc/parts.aspx |
Child Item | 39 | 33 | Procedures Calendar | ~/ITC_Console/noc/procedures/procedures.aspx |
Child Item | 40 | 33 | NOC Notes | ~/ITC_Console/noc/noc_notes/noc_notes.aspx |
<
telerik:RadGrid
ID
=
"rgParameters"
runat
=
"server"
AutoGenerateDeleteColumn
=
"True"
AutoGenerateEditColumn
=
"True"
AlternatingItemStyle-BackColor
=
"white"
GridLines
=
"None"
GroupingEnabled
=
"False"
Width
=
"100%"
Height
=
"500px"
AutoGenerateColumns
=
"False"
ondeletecommand
=
"rgParameters_DeleteCommand"
oninsertcommand
=
"rgParameters_InsertCommand"
onneeddatasource
=
"rgParameters_NeedDataSource"
onupdatecommand
=
"rgParameters_UpdateCommand"
oniteminserted
=
"rgParameters_ItemInserted"
>
<
AlternatingItemStyle
BackColor
=
"White"
/>
<
MasterTableView
Caption
=
"Parameters"
CommandItemDisplay
=
"TopAndBottom"
DataKeyNames
=
"ScheduleParaID,StartDate,EndDate,WeekScheduled,WEPHScheduled"
ShowFooter
=
"true"
>
<
Columns
>
<
telerik:GridBoundColumn
AllowFiltering
=
"False"
AllowSorting
=
"False"
DataField
=
"ScheduleParaID"
HeaderText
=
"ScheduleParaID"
ReadOnly
=
"true"
UniqueName
=
"ScheduleParaID"
Visible
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
AllowFiltering
=
"False"
DataField
=
"StartDate"
HeaderText
=
"Start Date"
UniqueName
=
"StartDate"
DataFormatString
=
"{0:dd/MM/yyyy}"
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridDateTimeColumn
AllowFiltering
=
"False"
DataField
=
"EndDate"
HeaderText
=
"End Date"
UniqueName
=
"EndDate"
DataFormatString
=
"{0:dd/MM/yyyy}"
Reorderable
=
"True"
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridNumericColumn
AllowFiltering
=
"False"
DataField
=
"WeekScheduled"
HeaderText
=
"Trains Scheduled (Week Days)"
UniqueName
=
"WeekScheduled"
AllowRounding
=
"False"
>
</
telerik:GridNumericColumn
>
<
telerik:GridNumericColumn
AllowFiltering
=
"False"
DataField
=
"WEPHScheduled"
HeaderText
=
"Train Scheduled (WE and Public Holidays)"
UniqueName
=
"WEPHScheduled"
AllowRounding
=
"False"
>
</
telerik:GridNumericColumn
>
</
Columns
>
<
EditFormSettings
EditFormType
=
"AutoGenerated"
></
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
protected
void
rgParameters_NeedDataSource(
object
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
TrainOperationParameters tparam =
new
TrainOperationParameters();
rgParameters.DataSource = tparam.Select();
tparam =
null
;
}
[DataObjectMethod(DataObjectMethodType.Select,
true
)]
public
List<TrainOperationParameters> Select()
{
List<TrainOperationParameters> list =
new
List<TrainOperationParameters>();
DataTable dt;
try
{
dt = DataMethods.ReturnMultipleRowResultSet(
"[IM].[GetTrainOpParameters]"
, String.Empty);
if
(dt.Rows.Count > 0)
{
foreach
(DataRow dr
in
dt.Rows)
{
TrainOperationParameters param =
new
TrainOperationParameters();
param.ScheduleParaID = Convert.ToInt32(dr[
"TrainOpParaID"
]);
param.StartDate = (DateTime)dr[
"StartDate"
];
param.EndDate = ((DateTime)dr[
"EndDate"
]);
param.WeekScheduled = Convert.ToInt32(dr[
"WeekScheduled"
]);
param.WEPHScheduled = Convert.ToInt32(dr[
"WEPHScheduled"
]);
list.Add(param);
}
}
}
catch
(Exception)
{
throw
;
}
finally
{
dt =
null
;
}
return
list;
}
<
telerik:RadODataDataSource
ID
=
"RadODataSource1"
runat
=
"server"
>
<
Transport
>
<
Read
Url
=
"http://localhost:8989/ODService.svc/"
DataType
=
"XML"
/>
</
Transport
>
<
Schema
>
<
telerik:DataModel
ModelID
=
"Thing"
Set
=
"Things"
>
<
telerik:DataModelField
FieldName
=
"Id"
/>
<
telerik:DataModelField
FieldName
=
"Name"
/>
<
telerik:DataModelField
FieldName
=
"Value"
/>
</
telerik:DataModel
>
</
Schema
>
</
telerik:RadODataDataSource
>
<
telerik:RadTreeView
ID
=
"RadTreeView1"
Runat
=
"server"
DataFieldID
=
"Id"
DataModelID
=
"Thing"
ODataDataSourceID
=
"RadODataSource1"
></
telerik:RadTreeView
>
<?
xml
version
=
"1.0"
encoding
=
"iso-8859-1"
standalone
=
"yes"
?>
<
feed
xml:base
=
"http://localhost:8989/ODService.svc/"
xmlns:d
=
"http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns
=
"http://www.w3.org/2005/Atom"
>
<
title
type
=
"text"
>Things</
title
>
<
id
>http://localhost:8989/ODService.svc/Things</
id
>
<
updated
>2012-07-03T10:27:17Z</
updated
>
<
link
rel
=
"self"
title
=
"Things"
href
=
"Things"
/>
<
entry
>
<
id
>http://localhost:8989/ODService.svc/Things(0)</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-07-03T10:27:17Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Thing"
href
=
"Things(0)"
/>
<
category
term
=
"RadApp.Data.Model.Thing"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Id
m:type
=
"Edm.Int32"
>0</
d:Id
>
<
d:Name
>Thing0</
d:Name
>
<
d:Value
>e55187e0-1439-4ac8-984b-504236caf274</
d:Value
>
</
m:properties
>
</
content
>
</
entry
>
<
entry
>
<
id
>http://localhost:8989/ODService.svc/Things(1)</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-07-03T10:27:17Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Thing"
href
=
"Things(1)"
/>
<
category
term
=
"RadApp.Data.Model.Thing"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Id
m:type
=
"Edm.Int32"
>1</
d:Id
>
<
d:Name
>Thing1</
d:Name
>
<
d:Value
>cfb491c8-9a07-4393-a539-5d7078cc9ded</
d:Value
>
</
m:properties
>
</
content
>
</
entry
>
<
entry
>
<
id
>http://localhost:8989/ODService.svc/Things(2)</
id
>
<
title
type
=
"text"
></
title
>
<
updated
>2012-07-03T10:27:17Z</
updated
>
<
author
>
<
name
/>
</
author
>
<
link
rel
=
"edit"
title
=
"Thing"
href
=
"Things(2)"
/>
<
category
term
=
"RadApp.Data.Model.Thing"
scheme
=
"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
/>
<
content
type
=
"application/xml"
>
<
m:properties
>
<
d:Id
m:type
=
"Edm.Int32"
>2</
d:Id
>
<
d:Name
>Thing2</
d:Name
>
<
d:Value
>7daecdaa-4a69-4f61-87f6-55eaca455ccc</
d:Value
>
</
m:properties
>
</
content
>
</
entry
>
</
feed
>
<
div
id
=
"RadTreeView1"
class
=
"RadTreeView RadTreeView_Clear"
>
<
input
id
=
"RadTreeView1_ClientState"
name
=
"RadTreeView1_ClientState"
type
=
"hidden"
autocomplete
=
"off"
value
=
"{"expandedNodes":[],"collapsedNodes":[],"logEntries":[],"selectedNodes":[],"checkedNodes":[],"scrollPosition":0}"
>
</
div
>