If in the content of RadGridView.ControlPanelItem has a binding with a RelativeSource or ElementName and the grid is placed in the collapsed UserControl, a binding error is thrown in the output window.
When using INotifyDataErrorInfo, items are still validated even when the ValidationType property is None.
Please note that when the AutoGeneratedColumns property is set to true, the item's HasErrors property will be evaluated, but only once.
Hello
I have often faced a scenarion where I have groups (GroupDescriptor), but those groups need to be ordered by a different property.
Usually, telerik column properties already provide a SortMemberPath.
<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" SortMemberPath="Id"
However, the GroupDescriptor does not have that, it only has Member and SortDirection.
The only way to set the sort to refer another property is in code behind using a generic group descriptor. It is very flexible, but it has several drawbacks, since now I'd have to declare everything in C# (aggregate functions, templates, etc) and also lose the Design time feedback from Visual Studio.
My request is to just have the possibility to set a SortMember in XAML which will work for most scenarios, same way as others components already do.
<telerik:GroupDescriptor Member="OrderState" SortDirection="Ascending"
SortMember="OrderStateIndex" >
Thanks
The MatchAllTerms search mode doesn't behave as epxected when the GroupRenderMode property of RadGridView is set to Flat.
To work this around, set the GroupRenderMode property of RadGridView to True.
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