• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Detect Shift or Control Click

I am trying to implement a screen similar to a windows listbox multiple-item selection (ctrl or shift click).  On windows, I can select non-continuous items by holding down the control key.

On my ASP.NET page,  I have a datagrid with a checkbox in a column that allows me to select multiple items.  Right now, I can get everything to work, but in order to start a new selection, I have to de-select everything that was previously selected.  I know I can clear the other checkboxes when the user checks off something else.  If I do this, is there anyway to detect a control click or a shift click so that I can determine whether or not to clear previously checked items or if I should allow multiple items to be selected.

I don't know if this is possible, but I'd just thought I'd ask.  If this is not possible, what would be the best way to implement a multiple item selection in a datagrid?
0
ardolino
Asked:
ardolino
  • 3
  • 3
1 Solution
 
EBatistaCommented:
check out this free custom control, it will do the job for you:
http://www.metabuilders.com/Tools/RowSelectorColumn.aspx

regards
0
 
ardolinoAuthor Commented:
I already have something like this and its working.  I need to know if you can detect a control click or a shift click from the web.  The problem with this control is that the user has to deselect the items after selecting them and performing an action on them.  I would prefer that the checkboxes work like the radio boxes UNLESS the user clicks on them with the control or the shift key.
0
 
EBatistaCommented:
mmm...i've never tackled what you want, but if there is a way to accomplish that, it will be using client side javascript.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
EBatistaCommented:
mmm...i've never tackled what you want, but if there is a way to accomplish that, it will be using client side javascript, discard pure server code solution here.
0
 
ardolinoAuthor Commented:
Ok, so now my question is... how?
0
 
armoghanCommented:
0
 
ardolinoAuthor Commented:
Thank you.  This is exactly what I wanted.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now