views:

517

answers:

2

Hi there,

I have I datagrid, on which I want to select multiple rows on a other user interaction than the one intended by the Programm. I'm wondering, whether I can programmatically select some rows depending only on code?

Thanks, Markus

+2  A: 

You can set the selectedIndices property to an array of indexes, or the selectedItems property to an array of items.

For example:

myDataGrid.selectedIndices = [1,2,5,8];
Robusto
Oh Thanks, thats great!
Markus
A: 

myDataGrid.selectedIndices = [1,2,5,8]; Doesn't work

Leonid