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.
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: 01 Jun 2020 09:40 by ADMIN
Release LIB 2020.2.601 (06/01/2020)

When you have rows grouped by null value and you try to move one of the rows to another group, a NullReferenceException is thrown.

This is reproducible only when DataView is used as ItemsSource of RadGridView.

To work this around, avoid using null values. Or avoid using DataView.

Completed
Last Updated: 01 May 2020 07:08 by ADMIN
Release LIB 2020.1.504 (05/04/2020)
Unplanned
Last Updated: 27 Apr 2020 08:25 by ADMIN
Add support for different merged cells orientation - MergedCellsOrientation.Mixed could be added.
Unplanned
Last Updated: 20 Apr 2020 11:44 by ADMIN
Apply sort/filter/group. Add option so that user can disable the UI update and be able to add new items, remove existing ones, change values so that UI is not updated. For example new item is on top of the sorted ones. Edite item does not change its place until sorting is reapplied/ resumed.
Completed
Last Updated: 06 Apr 2020 08:32 by ADMIN
Release LIB 2020.1.406 (04/06/2020)

The GroupRenderMode of the RadGridVIew is set to Flat. The control is populated with items that implement the IList interface. The Count property of the custom objects needs to return value bigger than 1. So when the Delete button is pressed, the rows beneath the deleted one will also be deleted. Their number depends on the Count property of the custom object.

 


Completed
Last Updated: 06 Jul 2020 12:32 by ADMIN
Release LIB 2020.2.713
When using Entity Framework Core 3 an InvalidOperationException is received upon adding an AggregateFunction to a column. 
Completed
Last Updated: 07 Aug 2024 08:11 by ADMIN
Release 2024.3.806 (2024 Q3)
When using Search as You Type behavior, the items will be first filtered using the keywords typed in the TextBox. We can create a way to disable this filtering.
Completed
Last Updated: 19 Mar 2020 11:37 by ADMIN
Release LIB 2020.1.323 (03/23/2020)
Currently, RadGridView scrolls three rows when using the mouse wheel. There should be an API that allows developers to change this setting.
Completed
Last Updated: 31 May 2021 08:04 by ADMIN
Release LIB 2020.2.323 (03/23/2020)

To reproduce this:

  1. Set the GroupRenderMode of RadGridView to Flat.
  2. Page RadGridView using RadDataPager.
  3. Scroll to the last row in the view. Or scroll to any row so that few of the rows above are not longer visible.
  4. Expand the row details and scroll down more until only the parent row is visible.
  5. Collapse the row details. At this point, the vertical scrollbar disappears and the upper rows are not brought into the view as expected when the row details gets collapsed.

To work this around call the Rebind() method of RadGridView on RowDetailsVisibilityChanged event.

 

private void RadGridView_RowDetailsVisibilityChanged(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
{
	if (e.Visibility == Visibility.Collapsed)
	{
		this.gridView.Rebind();
	}        
}

 

Won't Fix
Last Updated: 03 May 2022 13:40 by ADMIN
DataContext of rows is sometimes null when UI virtualization is enabled in the Flat group render mode.

The issue appears also without UI virtualization and in the Nested mode. It happens on ItemsSource reset of RadGridView, in case the old ItemsSource value wasn't empty. The DataContext is set to null for a brief moment before the old visuals are removed from the view, which causes issues in some scenarios related to CellTemplate
Completed
Last Updated: 11 Feb 2020 08:00 by ADMIN
Release R1 2020 SP1
The RowValidating event arguments give information about the edit operation that triggered the row validation - None, Edit or Insert. However, when the edit is canceled the EditOperationType is set to Edit. Change this and provide a new value (Cancel) or use None when the validation is canceled.
Completed
Last Updated: 08 Oct 2020 07:47 by ADMIN
Release LIB 2020.3.1012 (10/12/2020)
Created by: LindenauAtSOG
Comments: 3
Category: GridView
Type: Bug Report
2
As a Followup to this (Bad performance with grouping)Forumpost I managed to reproduce the issue now.
Since i cannot upload zip-files in the Forum I am doing it here.


The problem is, that a single grouping dramatically increases the time for sorting the values.
When the grouping is not present, sorting the same column is much faster.


It appears that it is related to the ammount of columns in total (not grouped).
The ammount of records is not so important, 100 (as in the attached sample) should not be significant.
Completed
Last Updated: 14 Feb 2020 08:27 by ADMIN
Release R1 2020 SP

Blank spaces where rows should appear are observed in the following situation. You start editing a row or a column, then scroll the row outside of the viewport before the edit was committed. Then sort a column.

This is reproducible only if the GroupRenderMode property of RadGridView is set to Flat. Also, the AutoGenerateColumns property should be set to False and the Columns should be added manually.

Note that the issue is reproducible also in RadTreeListView, which has the GroupRenderMode set to Flat by default.

To work this around, set the GroupRenderMode property of RadGridView to Nested.

Completed
Last Updated: 11 Oct 2022 11:00 by ADMIN
Release LIB 2020.1.203 (02/03/2020)

SearchStateManager property is null when trying to change any of the properties of the SearchStateManager object in the Loaded event. This behavior is observed when the ShowSearchPanel property is not set to true initially.

Completed
Last Updated: 03 Feb 2020 14:04 by ADMIN
Release LIB 2020.1.210 (02/10/2020)
There is a bug overriding the method ProvideCommandsForKey(Key key) in DefaultKeyboardCommandProvider.
When pressing F10, the received key is Key.System.

Unplanned
Last Updated: 17 Jan 2020 15:27 by ADMIN

We noticed that RadGridView does not get garbagecollected sometimes.
So i fired up  a memory analyzer to see what is going on.

This is the graph that shows that the RadGridView is causing a leak. The only references that keep the GridView from getting collected are those two WeakEventListeners

To further investigate i decompiled GridViewDataControl and could identify the culprit.

private void SubscribeToDispatcherShutdown()
    {
      if (this.dispatcherShutdownListener != null)
        this.dispatcherShutdownListener.Detach();
      this.dispatcherShutdownListener = new WeakEventListener<GridViewDataControl, object, EventArgs>(this);
      this.dispatcherShutdownListener.OnEventAction = (Action<GridViewDataControl, object, EventArgs>) ((grid, source, eventArgs) => grid.OnDispatcherShutdownFinished(source, eventArgs));
      this.dispatcherShutdownListener.OnDetachAction = (Action<WeakEventListener<GridViewDataControl, object, EventArgs>>) (weakEventListener => this.Dispatcher.ShutdownFinished -= new EventHandler(this.dispatcherShutdownListener.OnEvent));
      this.Dispatcher.ShutdownFinished += new EventHandler(this.dispatcherShutdownListener.OnEvent);
    }

In the second line from the botton

... weakEventListener => this.Dispatcher.ShutdownFinished -
... you are using 'this.Dispatcher...' which causes the leak since the Action will implicitly capture the 'this' reference.
Which kind of defeats the prupose of having a WeakReference inside your WeakEventListener.

Sadly i cannot figure out how it happens, but i think its only when Detach (FrameworkElement.Unloaded ultimately) is not called.
While this is the actual issue, i thought I'd share this with you so you.

Unplanned
Last Updated: 08 Jan 2020 09:32 by ADMIN
Created by: Dinko
Comments: 0
Category: GridView
Type: Feature Request
5
There is not a dedicated UI that allows hiding showing columns. You can achieve this using Control Panel functionality.
Unplanned
Last Updated: 23 Dec 2019 07:22 by ADMIN
Created by: Dinko
Comments: 0
Category: GridView
Type: Feature Request
6
A property like FilterMemberPath could be created. This way, we can control which property will be used by the Search As Type functionality.