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
75
How to automatically scroll to the selected row
posted

Hello,

In the code behind, I select the last row in the grid.

var selectedRows = this.webDataGrid.Behaviors.Selection.SelectedRows;
selectedRows.Add(this.webDataGrid.Rows[rowIndex]);

The row is selected but I don't see it because of the scroll pane.

How to automatically scroll to the selected row?

Thanks.

Parents
No Data
Reply
  • 29417
    Offline posted

    Hello schartrand ,

     

    Thank you for posting in our forum.

     

    There’s no way to set the scroll position on the server side but you could handle the client side Initialize event and in it  get the selected row. Then you could scroll that row into view using the cell’s

    scrollToView method. For example:

     

    function WebDataGrid1_Grid_Initialize(sender, eventArgs)

    {

        var row = sender.get_behaviors().get_selection().get_selectedRows().getItem(0);

        row.get_cell(0).scrollToView();

     

    }

     

    Let me know if you have any questions or concerns.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://es.infragistics.com/support

     

Children