<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StoresGrid.aspx.cs" Inherits="StoresGrid" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="sitefinity" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<
head
runat
=
"server"
>
<
title
>Stores with RadGrid client binder</
title
>
</
head
>
<
body
xmlns:sys
=
"javascript:Sys"
xmlns:dataview
=
"javascript:Sys.UI.DataView"
sys:activate
=
"*"
xmlns:code
=
"http://schemas.microsoft.com/aspnet/code"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"scriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Name
=
"MicrosoftAjax.js"
Path
=
"~/Sitefinity/Scripts/MicrosoftAjax.js"
/>
<
asp:ScriptReference
ScriptMode
=
"Inherit"
Path
=
"~/Sitefinity/Scripts/MicrosoftAjaxTemplates.js"
/>
<
asp:ScriptReference
ScriptMode
=
"Inherit"
Path
=
"~/Sitefinity/Scripts/MicrosoftAjaxAdoNet.js"
/>
</
Scripts
>
</
asp:ScriptManager
>
<
telerik:RadGrid
id
=
"storesGrid"
runat
=
"server"
allowpaging
=
"True"
AllowSorting
=
"true"
PageSize
=
"10"
>
<
MasterTableView
PageSize
=
"10"
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"BinderContainer0"
></
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"BinderContainer1"
></
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"BinderContainer2"
></
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Name"
SortExpression
=
"Name"
UniqueName
=
"BinderContainer3"
></
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Description"
SortExpression
=
"Description"
UniqueName
=
"BinderContainer4"
></
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"true"
EnableDragToSelectRows
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
<
sitefinity:RadGridBinder
id
=
"resourcesBinder"
runat
=
"server"
ServiceUrl
=
"~/Sitefinity/Services/Commerce/Stores.svc"
BindOnLoad
=
"true"
TargetId
=
"storesGrid"
DefaultSortExpression
=
"Name"
OnClientItemEditCommand
=
"OnItemEdit"
OnClientItemDeleteCommand
=
"OnItemDelete"
OnClientItemSelectCommand
=
"OnItemSelect"
DataMembers
=
"Id, Name, Description"
DataKeyNames
=
"Id"
>
<
Containers
>
<
sitefinity:BinderContainer
ID
=
"BinderContainer3"
runat
=
"server"
>
<
input
type
=
"button"
value
=
"Select"
class
=
"selectCommand"
/>
</
sitefinity:BinderContainer
>
<
sitefinity:BinderContainer
ID
=
"BinderContainer1"
runat
=
"server"
>
<
a
sys:href
=
"javascript:void(0);"
class
=
"editCommand"
>Edit</
a
>
</
sitefinity:BinderContainer
>
<
sitefinity:BinderContainer
ID
=
"BinderContainer2"
runat
=
"server"
>
<
a
sys:href
=
"javascript:void(0);"
class
=
"deleteCommand"
>Delete</
a
>
</
sitefinity:BinderContainer
>
<
sitefinity:BinderContainer
runat
=
"server"
>
<
strong
>{{Name}}</
strong
>
</
sitefinity:BinderContainer
>
<
sitefinity:BinderContainer
runat
=
"server"
>
<
strong
>{{Description}}</
strong
>
</
sitefinity:BinderContainer
>
</
Containers
>
</
sitefinity:RadGridBinder
>
<
script
type
=
"text/javascript"
>
function OnItemEdit(sender, commandArgs) {
alert(commandArgs.get_itemIndex());
}
function OnItemDelete(sender, commandArgs) {
alert(commandArgs.get_itemIndex());
}
function OnItemSelect(sender, commandArgs) {
alert(commandArgs.get_itemIndex());
}
</
script
>
</
body
>
</
html
>
The sample above was implemented as a standard stand-alone ASP.NET page.