We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid control features

Thread ID:





127355 Nov 9,2016 09:05 PM UTC Nov 11,2016 10:00 AM UTC JavaScript 3
Tags: ejGrid
Michael Salzlechner
Asked On November 9, 2016 09:05 PM UTC

looking at the grid control and i am wondering about the following features

programmatically setting the current row
i see how you can select rows but i am not sure if i can change the current row (similar to the user clicking on a row)

programmatically going to the top and bottom of the grid



Jayaprakash Kamaraj [Syncfusion]
Replied On November 10, 2016 01:25 PM UTC

Hi Michael, 
Thank you for contacting Syncfusion support. 
We can select the grid rows using selectRows method based on the index. We can get the row index based on the given tr element in grid using getIndexByRow() method. Please refer to the below help documents and code example. 
Help document for, 
// Create grid object. 
        var gridObj = $("#Grid").data("ejGrid"); 
       var index =  gridObj.getIndexByRow($(".e-gridcontent tr").first()); // here we will get index 
       gridObj.selectRows(index); // Selects rows based on the given index 

Jayaprakash K. 

Michael Salzlechner
Replied On November 10, 2016 02:04 PM UTC


i tried as documented

gridObj.selectRows(fromindex, toindex);


and this does not work. 


however does work

Jayaprakash Kamaraj [Syncfusion]
Replied On November 11, 2016 10:00 AM UTC

Hi Michael, 
If you want to select multiple rows in grid, we need to set selectionType as multiple in Grid . Please refer to the below help documents, code example and sample.   

Help document for, 

$(function () { 
                // the datasource "window.gridData" is referred from jsondata.min.js 
                dataSource: window.gridData, 
                allowPaging: true, 
                selectionType: "multiple", 
                columns: [ 
        $("#refresh").click(function () { 
            var obj = $("#Grid").ejGrid("instance"); 
            obj.selectRows(1, 4); 

Jayaprakash K. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon