Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3760
Scrolling event on RowSelectionChange
posted

Hello,

How can I prevent this scrolling to take place in the webhierarchical datagrid, or how can I "scroll to" the newly selected row in the grid

to ensure that it is always in focus.

I know it is possible on the server-side, but I need to control this on the client-side.

I have tried the solution below (as susggested on codecorner.galanter.net)

function whdgGrid_RowSelectionChanging(sender, eventArgs) {

    event.cancelBubble = true

}

but it does not cancel the event.

I also need to ensure that the solution is fully cross-browser compliant.

Regards.

My environment is as follows:

VS2010

IE9

Widows 7 32 bit.

Infragistics ASP.Net Version 11.2.20112.2125

.Net 4

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

Parents
  • 49378
    posted

    Hello JJB,

    Thank you for posting in the community.

    Can you be a little more specific as to when this scrolling is occurring while selecting a row ?

    In order to scroll to a row on the client, you may try something similar to:

    function WebHierarchicalDataGrid1_Selection_RowSelectionChanged(sender, eventArgs) {    

     if (eventArgs.getSelectedRows().get_length() > 0) {        

          eventArgs.getSelectedRows().getItem(0).get_element().scrollIntoView();

      }

    }

    however this would scroll the row as the first visible row in the grid.

    Please feel free to contact me with any questions.

Reply Children