<%@ Page EnableViewState="True" Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs"
    Inherits="_Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Untitled Page</title>

    <script type="text/javascript">

        function RowSelected(sender, args) {
            alert(sender.get_masterTableView().get_selectedItems()[0].getDataKeyValue("Name") + " selected.");
        }
    </script>

</head>
<body style="margin: 0px;">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <telerik:RadGrid ID="RadGrid1" AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="true"
            AutoGenerateColumns="false" runat="server" AllowMultiRowSelection="true">
            <MasterTableView ClientDataKeyNames="Name">
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" HeaderText="ID" DataType="System.Int32" />
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" />
                    <telerik:GridNumericColumn DataField="UnitPrice" HeaderText="Unit price" DataType="System.Decimal" />
                    <telerik:GridBoundColumn DataField="Date" DataFormatString="{0:d}" HeaderText="Date"
                        DataType="System.DateTime" />
                </Columns>
            </MasterTableView>
            <PagerStyle AlwaysVisible="true" />
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
                <DataBinding Location="~/WebService.asmx" SelectMethod="GetData" SelectCountMethod="GetCount" />
                <ClientEvents OnRowSelected="RowSelected" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
