This is a migrated thread and some comments may be shown as answers.

Scrolling RowDetails with a mouse click

1 Answer 16 Views
GridView
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 14 Nov 2011, 11:05 PM
Hi,

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,
George

1 Answer, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 15 Nov 2011, 11:36 AM
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);
            }
        }
Greetings,
Nikolay Vasilev
the Telerik team

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

Tags
GridView
Asked by
George
Top achievements
Rank 1
Answers by
Nick
Telerik team
Share this question
or