<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
    Culture="auto" %>

<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%@ 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 runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .RadGrid_Black .rgGroupHeader
        {
            color: Red !important;
        }
        window.onscroll =
        null;</style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server" ID="Manager1">
    </asp:ScriptManager>
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">

        <script type="text/javascript">

            var shouldCancel = false;
            
            function rowSelecting(sender, args) {
                if (shouldCancel) {
                    args.set_cancel(true);
                    shouldCancel = false;
                }
            }
            function clickHandler() {
                if (window.event.srcElement.type != "checkbox") {
                    shouldCancel = true;
                }
            }
                    
        </script>

    </telerik:RadScriptBlock>
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="AccessDataSource1" AutoGenerateColumns="False"
     AllowMultiRowSelection="true"
        OnPreRender="RadGrid1_PreRender" GridLines="None">        
        <MasterTableView CommandItemDisplay="Top" ShowGroupFooter="true"
            DataSourceID="AccessDataSource1">                    
            <Columns>
            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
            </telerik:GridClientSelectColumn>
                <telerik:GridBoundColumn DataField="OrderID" HeaderText="OrderID" SortExpression="OrderID"
                    UniqueName="OrderID" DataType="System.Int32">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" SortExpression="ProductID"
                    UniqueName="ProductID" DataType="System.Int32">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName"
                    UniqueName="ProductName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Quantity" DataType="System.Int16" HeaderText="Quantity"
                    SortExpression="Quantity" UniqueName="Quantity">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" HeaderText="UnitPrice"
                    SortExpression="UnitPrice" UniqueName="UnitPrice">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Discount" DataType="System.Single" HeaderText="Discount"
                    SortExpression="Discount" UniqueName="Discount">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ExtendedPrice" DataType="System.Decimal" HeaderText="ExtendedPrice"
                    ReadOnly="True" SortExpression="ExtendedPrice" UniqueName="ExtendedPrice">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings>
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings >
            <Selecting AllowRowSelect="True"  />
            <ClientEvents OnRowSelecting="rowSelecting" />
        </ClientSettings>
    </telerik:RadGrid>
    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb"
        SelectCommand="SELECT TOP 20 [OrderID], [ProductID], [ProductName], [Quantity], [UnitPrice], [Discount], [ExtendedPrice] FROM [Order Details Extended]">
    </asp:AccessDataSource>
    <br />
    </form>
</body>
</html>
