Click here to Skip to main content
15,887,875 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

In our application we are using list box which support selection of multiple values using keyboard (using control + space and down arrow key - it is basic functionality of any list box) but it allows only selection of sequential values.

I am looking to implement the functionality where user can select multiple values randomly using (Control + Space key). The similar functionality I could find in one of the Telerik control.

http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/accessibility/defaultcs.aspx

Can somebody help me in achieving the same functionality?

Just for reference: We are using MVC3(Razor), JavaScript and jQuery in our application.

Thanks in Advance.
Rahul
Posted
Comments
Sergey Alexandrovich Kryukov 10-Jun-13 14:23pm    
ASP.NET? tag it.
—SA

1 solution

This is not a functionality of ListBox, default of custom. And even if you implement a fully custom control with such behavior, if this control looks like a ListBox, it could confuse your users.

It looks like your application is ASP.NET. If so, I would advise alternative which would be way more clear to the users: System.Web.UI.WebControls.CheckBoxList:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.checkboxlist.aspx[^].

—SA
 
Share this answer
 
Comments
Pareek Rahul 11-Jun-13 14:11pm    
I think, I could not post my requirement properly.

I'll rephrase the requirement:

We are using ASP.NET application.We have a list box which contain some values e.g. let say there are 10 values A,B,C,D,E,F,G,H,I,J in the list box.

Using mouse and control key we can select any values sequentially (let say we need to select all the values from A to F) or randomly, let say we want to select only A, D, E, I. It is very much possible by combination of mouse and keyboard, but we want to achieve the same functionality using only keyboard (to help physically impaired users). It means when we want to select values sequentially we should be able to do it by combination of (Control+Shift+ Up/Down arrow key) and random values can be selected by (Control+ Up/Down arrow key + Spacebar).

As we are using Javascript and jQuery, any solution provided using these two will be helpful for me.

Thank in advance.
Sergey Alexandrovich Kryukov 11-Jun-13 14:25pm    
For a record, CheckBoxList I proposed will allow checking (instead of selection) with the keyboard, too, and it could be more apparent to the user. For multiple selection, you would need to create a custom control...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900