9 Answers, 1 is accepted
I have tested such a scenario and the GridView was scrolled up right to the item displayed at the top.
According to this thread you use the 2011.3.1220 version of the RadControls. Can you please confirm that?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I am actually having some issues with scrolling upwards with the ScrollIntoViewAsync.
It works if the item I am trying to scroll to is out of view considerably but not when it is only 10 rows out of sight.
This means that I am getting a gap in the scrolling function upwards, however downwards it works fine.
Any advice setting some properties like Height on the grid for instance?
I am using Telerik version 2012.1.0215.1040.
Please advice.
Regards,
Sebastian
I have tested scrolling to an item upwards. The item was brought into view.
When I read through your text, I am not sure that I understand this line "gap in the scrolling function upwards". Would you please show me a screenshot or send me a small test project to illustrate this "gap"?
Didie
the Telerik team
The "gap" I am referring to is the items in the middle are the rows that the ScrollIntoViewAsync method will consider as in view while they are not visible in the UI.
I tracked my problem down to the following method:
IScrollContentElement.IsInViewport
Which returns true even when the item is not showing.
I choose to go with another solution since I also need the item that is being scrolledintoview to be centered in the UI.
var focusElement = GetElementToScrollTo();
var datarow = focusElement.ParentOfType<Telerik.Windows.Controls.GridView.GridViewRow>();
var scrollBar = grid.ChildrenOfType<GridViewScrollViewer>().FirstOrDefault();
double
gridCenter = grid.ActualHeight / 2;
var transform = focusElement.TransformToVisual(grid
as
UIElement);
var myUiElementPosition = transform.Transform(
new
Point(0, 0));
double
scrollAmount = myUiElementPosition.Y - gridCenter;
//Debug.WriteLine("Diff from center:" + scrollAmount.ToString());
//Debug.WriteLine("Scrolling to:" + (scrollBar.VerticalOffset + scrollAmount).ToString());
scrollBar.ScrollToVerticalOffset(scrollBar.VerticalOffset + scrollAmount);
Hope that could help someone else.
//Sebastian
I am glad to hear that you have found a solution for your case.
I am still not able to scroll the item out of View. Could you please attach a screenshot describing the "gap"?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
I have the same problem and noticed all the behaviors described by Sebastian. I use version 2012.1.326 and EnableRowVirtualization is false. My grid is embeded in a RadPane docked at the bottom of my app and I noticed that the gap (described by Sebastian) is smaller when my pane/grid is smaller. The gap is approximately equal to the height of the grid (a little smaller).
Have you found a solution yet other than the one provided by Sebastian?
Christophe
Do you meet the same problem when the GridView is not embedded in a RadPane? Have you also tested with our most recent version - 2012 Q3 SP? If you can still reproduce the problem, then may I ask you to please open a support ticket sending us a demo project showing the exact case you have?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.