Declined
Last Updated: 11 Sep 2020 06:05 by ADMIN

Hi guys,

we have a messaging service that broadcasts a couple of messages every 1-5 seconds.

When our client module receives those messages, we want to append them at the bottom of a grid (RadGridView).

After appending them, we also want to scroll to the very bottom of that grid, so that the newest and therefore bottommost items come into view.

 

Documentation and forums suggest we go the AttachedBahaviour and ScrollIntoViewAsync way.

 

Our behaviour looks like this:


    public class ScrollToNewItemBehavior : Behavior<RadGridView>
    { 
        public static bool GetIsEnabled(DependencyObject obj) => (bool)obj.GetValue(IsEnabledProperty);
        public static void SetIsEnabled(DependencyObject obj, bool value) => obj.SetValue(IsEnabledProperty, value);
        public static readonly DependencyProperty IsEnabledProperty = DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(ScrollToNewItemBehavior), new PropertyMetadata(false, OnIsEnabledChanged));
        private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (d is RadGridView gridView)
                gridView.Items.CollectionChanged += (s, args) =>
                {
                    if (args.Action == NotifyCollectionChangedAction.Add)
                    {
                        gridView.ScrollIntoViewAsync(args.NewItems[0], gridView.Columns[0], null);

                        // exchanging args.NewItems[0] for gridView.Items[gridView.Items.Count-1] yields same result
                        //gridView.ScrollIntoViewAsync(gridView.Items[gridView.Items.Count-1], gridView.Columns[0], null);
                    }
                };
        } 
    }


 

Our Message class:


    public class Message : ModelBase<Message>
    {
        public string Text { get; set; }
    }


Our Messages collection in the ViewModel:


        private RadObservableCollection<Message> _messages;
        public RadObservableCollection<Message> Messages
        {
            get => _messages;
            set
            {
                _messages = value;
                NotifyPropertyChanged(m => m.Messages);
            }
        }


The collection is updated (in the ViewModel) like this:


            Task.Run(async () =>
            {
                for (int i = 0; ; i++)
                {
                    await Task.Delay(1000);
                    Messages.Add(new Message { Text = $"{i} - sftrvwj,erhvtwejhrfvtjlwehftrwejh" });
                }
            });


 

The grid is defined like this:


    <telerik:RadGridView
        x:Name="gridView"
        ItemsSource="{Binding Messages, Mode=OneWay}"
        IsSynchronizedWithCurrentItem="False"
        IsPropertyChangedAggregationEnabled="True"
        AutoGenerateColumns="False" 
        SelectionMode="Single"
        CanUserFreezeColumns="False"
        EnableColumnVirtualization="True"
        EnableRowVirtualization="True"
        CanUserDeleteRows="False"
        CanUserInsertRows="False"
        behaviours:ScrollToNewItemBehavior.IsEnabled="True"
        CanUserGroupColumns="False"
        IsReadOnly="True"
        IsManipulationEnabled="False"
        CanUserReorderColumns="False"
        CanUserSearch="False"
        ShowGroupPanel="False">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn
                DataMemberBinding="{Binding Text}"
                Header="Text"
                ShowDistinctFilters="False"
                IsSortable="False"/>
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>


Nothing too fancy.

 

What we observe:


 

When a message is added, the view and the scroll indicator randomly jump to the top or the bottom of the grid and stay there until the next message is added.

We tried AddRange, Suspend-/ResumeNotifications, ObservableCollection instead of RadObservableCollection.

We disabled many grid features.

We tried .NetCore

,

we tried .net Framework

To no avail.

This seems to be a bug.

 

Do you know any workarounds or a completely different approach to achieve the desired behaviour?

 

 

Side note:

When we set GroupRenderingMode to Flat,

        GroupRenderMode="Flat"

the view stays at the bottom. The scroll indicator stays at the bottom as well, but once in a while jumps a little bit up, as if by one row, and down to the bottom again without the view changing.

At one time disabling filtering on all columns seemd to work... but later didn't.

 

 

Thanks in advance

Thorsten

Completed
Last Updated: 30 Oct 2020 15:05 by ADMIN
Release R3 2020
A NullReferenceException is raised when trying to edit a GridViewMultiColumnComboBoxColumn and the RadGridView's ItemsSource is a DataView.
Completed
Last Updated: 24 Jun 2020 13:40 by ADMIN
Release LIB 2020.2.629 (6/29/2020)
Add mechanism to exclude columns from exporting when using GridViewSpreadStreamExport
Unplanned
Last Updated: 03 Jul 2020 07:25 by ADMIN
GridViewSpreadStreamExport throws exception exporting the control whit nested column groups and EnableColumnGroupsVirtualization set to False.
Unplanned
Last Updated: 22 Jun 2020 08:18 by ADMIN
The user wants an API with which he can set a formula. For example, the string "=A1+B1" will be translated in Excel like a formula.
Completed
Last Updated: 31 Aug 2020 10:40 by ADMIN
Release LIB 2020.2.831
 Expose mechanism to choose between loading all items or load only the items having containers
Unplanned
Last Updated: 30 Jun 2020 12:19 by ADMIN
Created by: Martin Ivanov
Comments: 0
Category: GridView
Type: Feature Request
1
Currently, when you scroll the RadGridView control the "click here to add new row" button goes out of the viewport. Allow to pin the button, so it float at the top or bottom of the viewport and to be always visible.
Completed
Last Updated: 17 Aug 2020 12:23 by ADMIN
Release LIB 2020.2.817 (08/17/2020)
Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Telerik.Windows.Controls.GridView.DataCellsPresenter', AncestorLevel='1''. BindingExpression:Path=Foreground; DataItem=null; target element is 'ContentControl' (Name='PART_ContentPresenter'); target property is 'Foreground' (type 'Brush'). Such errors are shown when loading data and using some of the newer themes (VisualStudio2019, Fluent, Crystal).
Declined
Last Updated: 09 Nov 2020 14:55 by ADMIN

I am using a RadGridView to display appointments. I am adding paging to the control with RadDataPager. I am setting the ItemSource property for the RadGridView to {Binding Path=PagedSource, ElementName=unscheduledWorkOrdersRadDataPager }. I am then overriding the ConvertDraggedData(object data) method and using the DataObjectHelper class in order to obtain data from the object data parameter and then setting the returned IEnumerable<IOccurence> accordingly.

The problem is that whenever I added paging to the RadGridView. The DataObjectHelper is not able to properly retrieve the dragged data from the object data parameter.

Unplanned
Last Updated: 10 Aug 2020 13:18 by ADMIN
Created by: Tobias
Comments: 0
Category: GridView
Type: Feature Request
1
Evaluate GroupBy queries on the server when the data source allows it.
Completed
Last Updated: 21 Aug 2020 06:28 by ADMIN
Release LIB 2020.8.224 (08/24/2020)
SearchMode property cannot be set in XAML because SearchStateManager is null initially.
Unplanned
Last Updated: 09 Oct 2020 12:04 by ADMIN
When the ItemsSource of the RadGridView is set to an implementation of ICollectionView, the Groups property is not utilized, since the groups are generated internally by the RadGridView. We can consider introducing support the Groups property to allow for grouping customizations.
Completed
Last Updated: 09 Nov 2020 14:20 by ADMIN
Release LIB 2020.3.1109 (11/09/2020)
When a GridViewRow has a validation error, a ToolTip with the error will appears on mouseover. If we scrolled the RadGridView, which has rows with errors, the tooltip starts to appear on valid rows. This behavior is reproducible when using the RowValidating event to validate the data.
Unplanned
Last Updated: 10 Nov 2020 11:13 by ADMIN
We can implement drag-scroll behavior when dragging column across the headers section of the columns.
Completed
Last Updated: 10 Jun 2021 11:49 by ADMIN
Release R2 2021 SP
Completed
Last Updated: 26 Apr 2021 09:05 by ADMIN
Release LIB 2020.3.1311 (1/11/2021)
In this scenario, we have two grids in different windows on different threads. When reordering columns in the first grid and reordered rows in the second will lead to an exception: System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.
Won't Fix
Last Updated: 10 Feb 2021 09:59 by ADMIN
The RadGridView's is bound to an empty DataView and grouped by a GridViewComboBoxColumn. When adding items during runtime, setting the SelectedItem in code or selecting through the UI -> the SelectedItem remains null. 
Completed
Last Updated: 31 May 2021 06:36 by ADMIN
Release LIB 2021.2.531 (31/05/2021)

This behavior is reproducible when the HorizontalAligment property of the control or its parent element is set to Left.

Completed
Last Updated: 31 May 2021 07:21 by ADMIN
Release LIB 2021.1.315 (03/15/2021)
Scrolling the RadGridView in the dropdown of the GridViewMultiColumnComboBoxColumn through mouse click&drag does not work. 
Unplanned
Last Updated: 11 Mar 2021 17:06 by ADMIN
Currently, the splitter is drawn with few pixels and a background color based on the current Telerik theme. Add an API like a Style or another type of property that allows you to change the default color and width of the splitter.