Scroll Item Into View DataGrid - CSharp System.Windows.Forms

CSharp examples for System.Windows.Forms:DataGrid

Description

Scroll Item Into View DataGrid

Demo Code


using System.Windows.Threading;
using System.Windows.Controls.Primitives;
using System.Windows.Controls;
using System.Windows;
using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Specialized;
using System.Collections.Generic;
using System;/*from  w ww.  j  ava 2  s  .  c  o m*/

public class Main{
        static object ScrollItemIntoView_DataGrid(object sender)
        {
            DataGrid dataGrid = sender as DataGrid;
            if (dataGrid != null && dataGrid.SelectedItem != null)
            {
                dataGrid.ScrollIntoView(dataGrid.SelectedItem);
            }
            return null;
        }
}

Related Tutorials