简体   繁体   中英

how to set selected rows in flash datagrid (as3)

I want to select multiple rows in current result set in DataGrid in flash as3. I tried to do it like that:

this.dataGrid.selectedItems = _selectedElements[index];

where _selectedElements is an array that holds results of prevoius selection on results page gathered like that:

_selectedElements[index] = this.dataGrid.selectedItems;

_selectedElements has correct values ( checked ) and I'm sure that the problem is with datagrid component.

Does anybody have a clue how to make it work?

I misunderstood you question first so I edited my answer. You can set selected rows like this:

myDataGrid.selectedIndices = [3,4,5,6];

To select a multiple rows, you have to write a coding in for loop using rows and columns. And by giving count eg.rows+1, rows-1 you can access the rows. same for column also. pls try this and let me know if you have any doubt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM