views:

20

answers:

1

Hey,

I have a list control and i want the user to be able to select many items at a time. Thus I want it to act that if the control key is pressed while he is clicking. Eg if he clicks on a selected row it should become unselected and if he clicks on a unselected row it should become selected.

Do you have any idea how to do this?

Thanks,

Dennis

+1  A: 

If you want to follow standard UI Precedent; then set allowMultipleSelection to true and teach your users to use the control and/or shift button to select multiple items.

If you want to select multiple items without having the using press the shift or control button you'll have to extend the List class. I did a sample a while ago using the DataGrid:

http://www.flextras.com/blog/index.cfm/2009/7/23/Flextras-Friday-Lunch--Episode-22--07032009--Auto-Select-DataGrid

http://www.flextras.com/labs/AutoSelectDataGrid/

http://www.flextras.com/labs/AutoSelectDataGrid/srcview/index.html

You can probably use the same technique with a List. But, I don't recommend this approach.

www.Flextras.com
Great answer. (+1)
modz0r