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.
Unfortunately, activation email could not send to your email. Please try again.

Grid control features

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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

thanks

Mike


Jayaprakash Kamaraj [Syncfusion]
Replied On November 10, 2016 08:25 AM

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, 
 
 
 
    <script> 
// 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 
    </script> 
 
Regards, 

Jayaprakash K. 


Michael Salzlechner
Replied On November 10, 2016 09:04 AM

thanks

i tried as documented

gridObj.selectRows(fromindex, toindex);

gridObj.selectRows(1,1);

and this does not work. 

gridObj.selectRows(1);

however does work


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

 
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 () { 
            $("#Grid").ejGrid({ 
                // 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); 
 
        }); 



Regards, 
 
Jayaprakash K. 


CONFIRMATION

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.

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.

;