Grid multiselect - method selectRows

Hi,

how to select noncontiguous rows using method selectRows in a multiselect grid? For example, row 1,3,5?
Thanks
Ragards
Stefano

3 Replies

IR Isuriya Rajan Syncfusion Team August 4, 2015 03:27 PM UTC

Hi Stefano,

We can achieve your requirement by using SelectRow public method.In this method we can pass the index of the row to select.

function btnClick(){

              var obj = $("#Grid").data("ejGrid");

          obj.clearSelection();

            for(i=0;i<obj.model.currentViewData.length;i++)

                {

              // will select alternative rows

                 if(i%2==1)

                 obj.selectRows(i);

              obj.multiSelectCtrlRequest = true;

              }

              }

We have created a sample and the same can be downloaded from the following location:

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/119799/Grid-2128873011.zip

Please refer to the below KnowledgeBase articles for more details.

http://www.syncfusion.com/kb/2979/how-to-select-or-highlight-rows-based-on-data

Please try the above sample and let us know if it helps.

Regards,

Isuriya R




SE Stefano Enrico September 9, 2015 11:56 AM UTC

Hi Isuriya,

thanks for the solution, but there is no api which pass an array of indexes? It would be very useful

obj.selectRows([1,3,5,7]);

Regards
Stefano


PK Prasanna Kumar Viswanathan Syncfusion Team September 10, 2015 06:05 AM UTC

Hi Stefano,


Query:  “Passing array of indexes in select rows method”


Currently we do not have support for select rows method, but we have created an improvement task for that. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 


https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents 


Regards, 

Prasanna Kumar N.S.V


Loader.
Up arrow icon