The column group headers are not displayed when the DisplayIndex property of the GridViewColumn objects is set before the control is loaded.
To work this around, you can set the DisplayIndex of the columns after the RadGridView is loaded.
Arrow keys (up and down) don't scroll the first row which is outside of the viewport. One way to reproduce this is to scroll down, then select the topmost visible row and press the Up arrow key in order to select the row above. This should scroll the view a bit up in order to see the previous row which is now selected.
Currently, this doesn't work when using a custom implementation of the GridViewCell class.
The issue is reproducible when GroupRenderMode is set to Flat.
To work this around, you can manually scroll to the row.
public MainWindow()
{
InitializeComponent();
this.gridView.AddHandler(RadGridView.KeyUpEvent, new KeyEventHandler(OnGridViewKeyUp), true);
}
private void OnGridViewKeyUp(object? sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Up || e.Key == Key.Down)
{
Dispatcher.BeginInvoke(new Action(() =>
{
var currentCell = gridView.CurrentCell;
var row = currentCell.ParentRow;
// Since the VisualOffset proeprty is protected and you are already inheriting the GridViewRow class, you can just expose it through an extra property in the CustomGridViewRow, instead of using reflection like in this example.
var visualOffsetPropInfo = typeof(Visual).GetProperty("VisualOffset", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
var offset = (Vector)visualOffsetPropInfo.GetValue(row);
if (offset.Y < 0)
{
row.BringIntoView();
}
}));
}
}
InvalidCastException is thrown when the DropIndicatorThickness property of the GridViewHeaderCell is set. Or whenever the DropIndicatorBrush property is accessed. This happens when using the Windows 7 theme. Also, the EnableColumnVirtualization property should be set to False.
System.InvalidCastException: 'Unable to cast object of type 'System.Windows.Media.LinearGradientBrush' to type 'System.Windows.Media.SolidColorBrush'.'
To work this around, you can use an implicit style targeting the GridViewHeaderCell in order to set its DropIndicatorBrush to a SolidColorBrush value.
<telerik:RadGridView.Resources>
<Style TargetType="telerik:GridViewHeaderCell">
<Setter Property="DropIndicatorBrush" Value="White" />
<Setter Property="DropIndicatorThickness" Value="10" />
</Style>
</telerik:RadGridView.Resources>
The UI is not updated when an item is replaced in the bound ListCollectionView.
Workaround: Remove the item and add a new one.
Column groups may disappear when the RadGridView control is hosted in a TabItem of TabControl. These column groups can disappear when new GridViewColumnGroup instances are created.
Furthermore, resizing a column of RadGridView will result in a NullReferenceException.
To work this around, set the EnableColumnGroupsVirtualization property of RadGridView to False.
Empty cells appear when the RadGridView contains many cells in the viewport and the view gets resized.
To work this around you can extract and modify the ControlTemplate of GridViewCell, in order to set the MinHeight property of the "PART_ContentPresenter" element to a number close to the RowHeight of the RadGridView control.
In the Office2019 theme, the RadGridView's ScrollBar elements should have transparent background by design. This is the track's background shown behind the thumb element that allows drag-to-scroll. Currently, the ScrollBars have a gray background.
To work this around, you can define an implicit Style in the App.xaml that targets the GridViewScrollViewer control. Then, set its Background property.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/System.Windows.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
<ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style TargetType="telerik:GridViewScrollViewer" BasedOn="{StaticResource GridViewScrollViewerStyle}">
<Setter Property="Background" Value="Transparent"/>
</Style>
</ResourceDictionary>
</Application.Resources>
The cell content gets clipped when the width of the previous column changes at runtime. This happens in the Windows11 and Office2019 themes (possibly in others) and only if the clipped cell is position before the right frozen columns area.
To work this around, you can call the Rebind() method of RadGridView, after the column width changes.
Dear Telerik Support Team,
I am encountering an issue with the RadGridView control in my application, which is impacting the usability for users relying on screen readers. Below, I have outlined the details of my development environment, the problem, and attached a sample project demonstrating the issue.
Issue Description:
In the attached sample project, I have implemented a simple RadGridView without any custom styling and populated it with sample data. I have observed that the focus behavior is inconsistent, particularly with the first cell in the RadGridView. When attempting to focus the first cell, only the cell itself receives focus, unlike subsequent cells where both the cell and the entire row are focused. This inconsistency results in screen readers failing to read out the content of the first cell, while they correctly read the contents of all other cells.
Upon further investigation using the Snoop utility to explore the visual tree, I noticed that the GotFocused event for the initially focused cell identifies it as being of type RadGridView, whereas, for other cells, the type is GridViewCell. This discrepancy seems to be at the root of the issue.
Attachments:
I have included a simplified, runnable standalone application that reproduces this behavior. Please find the sample project attached to this ticket.
I believe this might be a bug affecting the accessibility of the application, and I would greatly appreciate your guidance on whether this is a known issue with a workaround or if there's a fix available.
Thank you for your assistance.
Best regards,
Christian
First Tab:
Second Tab:
The first two pinned rows are scrolled outside of the viewport when you scroll. For example, if you pin 4 rows, the first two will be scrolled and you will see only the second two pinned. This reproduces in the Green, Windows 11, Crystal and Office2019 themes.
To work this around, set the UseLayoutRounding property of RadGridView to "False". Or use a different Telerik theme.