number
The selectedRowIndex allows you to select a row at initial rendering. You can also get the currently selected row index.
Defaults to -1
Thank you very much.
|
export class App extends React.Component {
constructor() {
super(...arguments);
}
grid;
flag = true;
settings = { type: 'Multiple' }
dataBound(args) {
//flag variable is used to achieve selection only in grid’s initial rendering
if (this.flag) {
this.flag = false;
this.grid.selectRows([0, 1, 3]) // select multiple rows in the grid using indexes
}
}
render() {
this.dataBound = this.dataBound.bind(this);
return (<div>
<GridComponent dataSource={data} height={320} dataBound={this.dataBound} selectionSettings={this.settings} ref={g => this.grid = g}>
<ColumnsDirective>
<ColumnDirective field='OrderID' headerText='Order ID' width='100' textAlign="Right" />
<ColumnDirective field='CustomerID' headerText='Customer ID' width='100' />
<ColumnDirective field='ShipCountry' headerText='Ship Country' width='100' />
</ColumnsDirective>
</GridComponent></div>
);
}
}
|