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

[Solved] ScrollIntoView With Frozen column

1 Answer 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frederic Naslis
Top achievements
Rank 1
Frederic Naslis asked on 30 Oct 2011, 10:00 PM
Hi , i go one frozen column in a gridview, and a custom event where i want to set a specific column as a second column , like simulating a scroll event on the horizontal scrollbar. Is there anyway to do it by the ScrollIntoView Method ? In my case it only works if i already move the horizontal scrollbar , in others cases it doesn't move ...
Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 31 Oct 2011, 05:26 PM
Hello Frederic Naslis,

 As I understand you would like to have the second column scrolled right after the first (frozen column).

Generally the default behavior of the Scrolling Into View is to show the column, containing the particular cell in the right end of the view area.

In order to get the column aligned to the left of the grid, you may call ScrollIntoViewAsync twice - to the end of the grid and then to desired column. This way the position of the specified column will be scrolled to the left of the view area.

You may change your code like:

this.playersGrid.ScrollIntoViewAsync(((FrameworkElement)e.Source).DataContext,
currentColumn,
newAction<FrameworkElement>((d) =>
{
this.playersGrid.ScrollIntoViewAsync(((FrameworkElement)e.Source).DataContext, //the row
currentColumn, //the column
new Action<FrameworkElement>((f) =>
{
GridViewRow row = f asGridViewRow;
if(row != null)
   row.Cells.Cast<GridViewCell>().First(c => c.Column == currentColumn).Focus();
}));
                }));

May you please try this in your project and share with us if this is solving your scrolling issue.

Regards,
Didie
the Telerik team

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

Tags
GridView
Asked by
Frederic Naslis
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or