New to Telerik UI for WPFStart a free 30-day trial

Scroll to Newly Added Item

Updated on Sep 15, 2025

This article shows how to scroll RadGridView to the newly added item.

You can achieve this by using the ScrollIntoViewAsync method and the CollectionChanged event of the control's Items collection. For the purpose, you can create a custom behavior and attach it to your RadGridView control.

Example 1: The custom behavior

C#
    public class ScrollToNewItemBehavior : Behavior<RadGridView>
    {
        private RadGridView GridView
        {
            get
            {
                return this.AssociatedObject as RadGridView;
            }
        }

        protected override void OnAttached()
        {
            base.OnAttached();
            this.GridView.Items.CollectionChanged += OnCollectionChanged;
        }

        protected override void OnDetaching()
        {
            base.OnDetaching();
            this.GridView.Items.CollectionChanged -= OnCollectionChanged;
        }

        private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
        {
            if (args.Action == NotifyCollectionChangedAction.Add)
            {
                this.GridView.ScrollIntoViewAsync(args.NewItems[0], this.GridView.Columns[0], null);
            }
        }
    }

Example 2 and Example 3 demonstrate how you can apply the new behavior to all RadGridView instances in your application by creating an attached property which you can then use in an implicit style.

Example 2: Defining the attached property

C#
    public class GridViewAttachedProperties
    {
        public static bool GetScrollToNewItem(DependencyObject obj)
        {
            return (bool)obj.GetValue(ScrollToNewItemProperty);
        }

        public static void SetScrollToNewItem(DependencyObject obj, bool value)
        {
            obj.SetValue(ScrollToNewItemProperty, value);
        }

        public static readonly DependencyProperty ScrollToNewItemProperty =
            DependencyProperty.RegisterAttached("ScrollToNewItem", typeof(bool), typeof(GridViewAttachedProperties), new PropertyMetadata(false, OnScrollNewItemIntoViewChanged));

        private static void OnScrollNewItemIntoViewChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var gridView = d as RadGridView;
            if (gridView != null)
            {
                var scrollToNewItem = GetScrollToNewItem(d);
                var behaviors = Interaction.GetBehaviors(d);
                var scrollToNewItemBehavior = behaviors.SingleOrDefault(x => x is ScrollToNewItemBehavior);

                if (scrollToNewItemBehavior != null && !scrollToNewItem)
                {
                    behaviors.Remove(scrollToNewItemBehavior);
                }
                else if (scrollToNewItemBehavior == null && scrollToNewItem)
                {
                    scrollToNewItemBehavior = new ScrollToNewItemBehavior();
                    behaviors.Add(scrollToNewItemBehavior);
                }
            }
        }
    }

Example 3: Set the attached property in an implicit style

XAML
    <Application.Resources>
        <Style TargetType="telerik:RadGridView">
            <Setter Property="local:GridViewAttachedProperties.ScrollToNewItem" Value="True" />
        </Style>
    </Application.Resources>

If you're using implicit styles, you should base your style on the RadGridViewStyle as explained in this article.

See Also

In this article
See Also
Not finding the help you need?
Contact Support