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">
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(); } }
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.
Hello Petar,
Thank you for the reply. I have however resolved it by enabling the activation behavior in conjunction with the cancelling the "event.cancelBubble" during the
RowSelectionChanging event.
This seems to give us the control over the scrolling behavior we require.