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

[Solved] Q3 How can I control the horizontal scrollbar of GridView?

1 Answer 151 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.
Zinc Deng
Top achievements
Rank 1
Zinc Deng asked on 08 Dec 2009, 02:59 AM
In the lastest Q3 version, how can I control the horizontal scrollbar of GridView?

this.RadGridView.ItemsControl.VirtualizingPanel.SetVerticalOffset()
No Work.

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 08 Dec 2009, 11:45 AM
Hello Zinc Deng,

You can do it like this:

using System.Windows.Controls;
using Telerik.Windows.Controls;
using Telerik.Windows.Data;
using Telerik.Windows.Controls.GridView;
 
namespace TicketID_263667_ConditionalFormattingWithCellTemplate
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
 
            this.playersGrid.DataLoaded += new System.EventHandler<System.EventArgs>(playersGrid_DataLoaded);
            this.playersGrid.ItemsSource = Club.GetPlayers();
        }
 
        void playersGrid_DataLoaded(object sender, System.EventArgs e)
        {
            var scrollViewer = this.playersGrid.ChildrenOfType<GridViewScrollViewer>()[0];
            scrollViewer.ScrollToHorizontalOffset(30);
            scrollViewer.ScrollToVerticalOffset(30);
        }
    }
}

I hope this helps.

Regards,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Zinc Deng
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or