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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disable horizontal auto scroll

Thread ID:

Created:

Updated:

Platform:

Replies:

142799 Feb 20,2019 10:19 AM UTC Feb 20,2019 12:03 PM UTC JavaScript - EJ 2 3
loading
Tags: Grid
Gary
Asked On February 20, 2019 10:19 AM UTC

Hi,

     I have a grid control with lots of columns. If I scroll horizontally to see the columns that are out of view on the right and then double click to edit a cell, the grid auto scrolls to the first editable cell in the row. 

Is there a way to prevent this behaviour and to set focus to the clicked cell (or nearest editable cell) instead ?

Thanks for your help.

Gary

Pavithra Subramaniyam [Syncfusion]
Replied On February 20, 2019 10:55 AM UTC

Hi Gary, 
 
We have analyzed your query and we suggest you to use JavaScript dblClick event to achieve your requirement. In the event, we can get the clicked td element and we add the focus to that cell by its column index. Please find the below sample for your reference.  
   
[index.cshtml]  
   
  var grid = document.getElementById("Grid");   
    grid.addEventListener("dblclick", cellSelect);  
                
    function cellSelect(event) {   
        var colIndex = event.target.getAttribute("aria-colindex");   
        event.currentTarget.querySelectorAll(".e-field")[colIndex].focus();   
    }   
 
 
   
Please get back to us for further assistance. 
 
Regards, 
Pavithra S. 


Gary
Replied On February 20, 2019 11:45 AM UTC

Thanks for your help. It works great (with a slight tweak to subtract the number of frozen columns from colindex).

Gary



Pavithra Subramaniyam [Syncfusion]
Replied On February 20, 2019 12:03 PM UTC

Hi Gary, 
 
Thanks for your update. 

We are happy to hear that the provided information helps you. 

Please contact us if you need any further assistance. As always, we will be happy to assist you.  
 
Regards, 
Pavithra S. 


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.

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

Live Chat Icon For mobile
Live Chat Icon