Can I multiselect rows at initial rendering

I am looking for something like selectedRowIndex(

The selectedRowIndex allows you to select a row at initial rendering. 

Defaults to -1

), but need select more than one rows at initial rendering.


Thanks

Fan


1 Reply

RS Rajapandiyan Settu Syncfusion Team August 22, 2022 02:48 PM UTC

Hi Zhang,


Thanks for contacting Syncfusion support.

By using selectRows method in the dataBound event, you can select multiple rows in the Grid.


selectRows: https://ej2.syncfusion.com/vue/documentation/api/grid/#selectrows
dataBound: https://ej2.syncfusion.com/vue/documentation/api/grid/#databound


    dataBound: function (args) {

      if (this.isInitialRender) {
        // below code executed only at initial render

        this.isInitialRender = false;

        this.$refs.grid.ej2Instances.selectRows([1, 3, 5]);

      }

    }

 


Sample: https://codesandbox.io/s/vue-template-forked-2kd7lw?file=/src/App.vue

Please get back to us if you need further assistance.


Regards,

Rajapandiyan S


Loader.
Up arrow icon