When adding a button cell as below, if the button cell is selected the button doesn't work when tapping it.
<telerik:GridViewDataColumn Header="Config"
DataMemberBinding="{Binding .}" IsReadOnly="True">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<!-- Adding telerik:TouchManager.TouchMode="None" solves the issue -->
<telerik:RadButton HorizontalAlignment="Center" Style="{StaticResource MyButtonStyle}"
Margin="2" Padding="1" Width="Auto" Height="Auto"
Command="{Binding DataContext.ShowExtraConfigurationCommand, RelativeSource={RelativeSource AncestorType=Window}}"
CommandParameter="{Binding .}" ToolTip="Config">
<telerik:RadGlyph Glyph="{StaticResource GlyphGear}"/>
</telerik:RadButton>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
As stated in the comment, adding the property below to the RadButton solves the issue.
telerik:TouchManager.TouchMode="None"
I have attached a sample project in which the error occurs, simply tap a button, close the MessageBox and tap the same button again. Thank you for your time!
NullReferenceException occurs when the the automation peers creation for the rows goes over 10,000 peers (the MaxCachedPeersSize setting of the GridViewDataControlAutomationPeer). The exception occurs only when the 'record' modifier is used in the class definition. For example:
public record class MyClass(int Id)
{
}
The exception stacktrace is:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
peer was null.
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewDataControlAutomationPeer.ClearPeer(Telerik.Windows.Automation.Peers.DataItemAutomationPeer peer) Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewDataControlAutomationPeer.GetOrCreateItemPeer(object item, int index) Line 288 C# Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewRowAutomationPeer.FindDataItemAutomationPeer(System.Collections.Generic.List<System.Windows.Automation.Peers.AutomationPeer> childPeers) Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Automation.Peers.GridViewRowAutomationPeer.GetChildrenCore()
.
To work this around use the "class" modifier instead of "record". For example, instead of:
public record class MyClass(int Id)
{
}
Use:
public class MyClass
{
public int Id { get; set; }
}
Or alternatively, increase the MaxCachedPeersSize value.
If a RadDocking has its theme set to Windows 11 via the StyleManager.Theme attached property, placing a RadGridView inside (styled with a different theme, such as Office_Black, Summer, etc.) will cause its cells to look merged after performing an edit operation.
As a workaround, the RowHeight and the FontSize properties of the RadGridView instance can be used to resolve this.
The following exception is raised when adding a ColumnGroupDescriptor to the GroupDescriptors property of a RadGridView. This bug is data specific and I've only been able to duplicate it with a large data set but the issue seems like it could be addressed without the actual data, given that the code causing the issue is apparently passing a pixelWidth < 0.
System.ArgumentOutOfRangeException: 'The parameter value must be greater than zero.
Parameter name: pixelWidth'
You are able to resize columns using the columns gripper. The corresponding group will be automatically resized. We can provide a way to resize the column groups. The columns inside the group will be automatically resized with the group.
The GridViewSelectColumn displays a CheckBox in its header, which selects all rows in the column. If the CheckBox is unchecked, and you click it to check the items, the items get selected/checked. However, the CheckBox doesn't get check until the second click.
This reproduces only when the RadGridView is grouped and also the groups are collapsed so that no data records are visible.
To work this around, you can replace the default CheckBox with a new one in the column's Header. Then, manually select and deselect the items. You can use the CheckBox MouseLeftButtonDown or Checked/Unchecked events. Note that it is important to wrap the CheckBox in the Header, in another control (like a Grid in the example below), in order to avoid the default RadGridView logic to kick-in.
<telerik:GridViewSelectColumn>
<telerik:GridViewSelectColumn.Header>
<Grid>
<CheckBox PreviewMouseLeftButtonDown="CheckBox_PreviewMouseLeftButtonDown"/>
</Grid>
</telerik:GridViewSelectColumn.Header>
</telerik:GridViewSelectColumn>
private void CheckBox_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
var checkBox = (CheckBox)sender;
if (checkBox.IsChecked.Value)
{
this.GridView.SelectedItems.Clear();
}
else
{
this.GridView.SelectAll();
}
}
When the RadGridView is filtered you can get all items in the data view using the Items collection property of the control. The count can be accessed with the gridView.Items.Count property.
If the RadGridView is grouped and then filtered, the Items.Count no longer returns the correct value. The count doesn't take into account the items that are in collapsed groups. Instead the count contains only the expanded group objects.
To work this around, use the following code instead of gridView.Items.Count.
int count = gridView.Items.OfType<object>().Count();
The selection with the Shift key when SelectionMode=Extended no longer works in the default Nested rendering mode of RadGridView. This reproduces only when the data view is grouped.
To work this around, set the GroupRenderMode property of RadGridView to Flat.
<telerik:RadGridView GroupRenderMode="Flat" />
Exception when resizing column with width set to star and min-width set to 0.
Set the properties to the above and resize a column to 0 and then to the original width -> an exception occurs.
The RadGridView control hangs when the frozen columns are enabled and the application is resized. The exact resizing depends on the screen resolution and the exact new size. This was originally recreated on a monitor with 1600x900 resolution 125% DPI and the application was maximized (resized from restored to full screen size). The issue occurs in the Fluent theme. Also, the FluentPalette.Palette.ScrollBarsMode static property should be set to Normal.
To work this around, you can overrider the MeasureOverride method of RadGridView and add the following code:
public class CustomGridView: RadGridView
{
private static readonly PropertyInfo internalColumnsProp = typeof(GridViewDataControl).GetProperty("InternalColumns", BindingFlags.Instance | BindingFlags.NonPublic);
private static MethodInfo invalidateColumnsMethod;
protected override Size MeasureOverride(Size availableSize)
{
if (EnableRowVirtualization && !double.IsInfinity(availableSize.Height))
{
var internalColumns = internalColumnsProp.GetValue(this);
if (invalidateColumnsMethod == null)
{
invalidateColumnsMethod = internalColumns.GetType().GetMethod("InvalidateColumnWidthsCalculation", BindingFlags.Instance | BindingFlags.NonPublic);
}
invalidateColumnsMethod.Invoke(internalColumns, null);
}
return base.MeasureOverride(availableSize);
}
Currently the filters for the RadGridView only allows 2 filters. It would be very helpful for the default filter popout to have the option to add additional filters.
Current filter popout:
Filter popout with ability to add additional filters via an Add Filter button:
Competitor's GridView controls have this feature already and it would be very useful to have this feature on the RadGridView control.