Scrolling RowDetails with a mouse click

2 posts, 0 answers
  1. George
    George avatar
    6 posts
    Member since:
    May 2011

    Posted 14 Nov 2011 Link to this post


    I have a grid with RowDetailsVisibilityMode="Visible" and the height of the grid is such that  only 1 and a half rows are visible.  The RowDetails items are fairly tall.  When the top row is only partly visible and I click on it with the mouse, the entire top row and its Row Details scrolls into view to become visible.  However, when the bottom row is only partly visible and I mouse click on it the row and its Row Details does not move and I have to manually scroll the rest of it into view.

    In the SelectionChanged event handler I call  ScrollIntoViewAsync(View.CurrentItem, null); to do the scrolling.

    Can you tell me what I can do to make a mouse click on a partly visible bottom row details item cause it to become entirely visible?

    Thanks in advance,
  2. Nick
    Nick avatar
    593 posts

    Posted 15 Nov 2011 Link to this post

    Hello George,

     You can subscribe to MouseLeftMouseButtonDown on the RowDetailTemplate that you have created and do the ScrollIntoView there. 

    private void RowDetails_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
                var parent = this.ParentOfType<RadGridView>();
                if (parent != null)
                    parent.ScrollIndexIntoViewAsync(parent.Items.IndexOf(parent.SelectedItem), null);
    Nikolay Vasilev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top