This is a migrated thread and some comments may be shown as answers.

[Solved] DisableControlKeyForMultiRowSelection

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Princy
Top achievements
Rank 2
Princy asked on 08 Jan 2008, 01:01 PM

Requirements

RadControls version

5.0.1.0
.NET version

2.0
Visual Studio version

2005
programming language

C#
browser support

all browsers supported by RadControls


 
PROJECT DESCRIPTION

This project describes how to disable the Control key for Multi row selection .

ASPX:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %> 
<!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> 
     <script language="javascript" type="text/javascript"
      
      
      function OnRowClick(index) 
                { 
                 var e = window.event;               
                if (event.ctrlKey==1) 
                  return false; 
                else 
                  return true; 
                } 
      </script> 
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <radg:radgrid id="RadGrid1" runat="server"  
            allowmultirowselection="True" autogeneratecolumns="False" datasourceid="SqlDataSource1" 
            gridlines="None" EnableAJAX="True" Skin="Ice" > 
             
             <MasterTableView  DataSourceID="SqlDataSource1" DataKeyNames="CategoryID" > 
             
             <Columns> 
             <radG:GridBoundColumn  HeaderText="CategoryID" UniqueName="CategoryID" DataField="CategoryID"
             </radG:GridBoundColumn> 
             <radG:GridBoundColumn  HeaderText="CategoryName" UniqueName="column" DataField="CategoryName" ></radG:GridBoundColumn> 
             <radg:GridClientSelectColumn UniqueName="column1"
             </radG:GridClientSelectColumn> 
             </Columns> 
                 <ExpandCollapseColumn Resizable="False" Visible="False"
                     <HeaderStyle Width="20px" /> 
                 </ExpandCollapseColumn> 
                 <RowIndicatorColumn Visible="False"
                     <HeaderStyle Width="20px" /> 
                 </RowIndicatorColumn> 
              </MasterTableView> 
             <ClientSettings> 
             <ClientEvents OnRowClick="OnRowClick" /> 
             <Selecting  AllowRowSelect="True" /> 
             </ClientSettings> 
            <ExportSettings> 
                <Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in" 
                    PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" /> 
            </ExportSettings> 
               
             </radg:radgrid> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyNorthwindConnectionString %>" 
            SelectCommand="SELECT TOP 10 [CategoryID], [CategoryName] FROM [Sales by Category]"></asp:SqlDataSource> 
    </div> 
    </form> 
</body> 
</html> 
 


Princy

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 11 Jan 2008, 09:19 AM
Hi Princy,

I reviewed the code sample and it is a good one. However, since it is not a very complex one, I have transferred the code library entry into a forum post, so that other users can benefit from it as well.
As a token of gratitude, for sharing your solution with the community, I have updated your Telerik points.
Good luck with your work!

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Princy
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Share this question
or