How should the shift key affect this code?
Forget to mentioned i am executing the above mentioned statements on change event of the datagrid control. So, whenever i am pressi Shift key and try to select the one above or below rows of the datagrid with up or down arrow i am able to select only two rows at a time not more than that.
private function dgItemChangeHandler(event:Event):void
var dataGrid:DataGrid = DataGrid(event.target);
var selectedArray:Array = new Array();
selectedArray = dataGrid.selectedIndices;
dataGrid.selectedItems = selectedArray;
1 person found this helpful
If you are setting selectedItems/selectedIndicies it will ignore shift key.
Setting selectedItems based on selectedIndicies probably won't work either.
So the default Shift key functionality will not work if we assign the selectedindices through code.Is there any work around for it.Thanks for the reply.
If you keep track of the last set of selectedIndicies you can compute the
new set. If you need the selection anchor to do it, you can subclass and