Hi,
as you can see in the screenshot below the new dark Material Theme has the bug, that the selected row is white if it's not focused.
I can not find in the code where this white color comes from.
I encountered it only in the GridView and TreeListView yet.
Also I can say, that it wasn't like that before the new update. I made my own dark material theme and it didn't appear like this before.
Greetings Benedikt
Calling the BeginInsert() method of RadGridView, adds a new row at the bottom of the items and scrolls to the newly added row. However, if the vertical scrollbar is not visible and the newly added row makes the viewport so big that the scrollbar should display, the row gets clipped. Also, the vertical scrollbar that was just added is not scrolled to the bottom, which is actually why the row is clipped. Each next insert (after the scrollbar gets visible) will display the added row properly.
To work this around, you can scroll the vertical scrollbar manually to bottom.
private void BeginInsertRow()
{
var scrollViewer = this.gridView.FindChildByType<GridViewScrollViewer>();
bool requestScrollToBottom = false;
if (scrollViewer.ComputedVerticalScrollBarVisibility == Visibility.Collapsed)
{
var panel = this.gridView.FindChildByType<GridViewVirtualizingPanel>();
var sumHeight = (source.Count + 1) * this.gridView.RowHeight;
requestScrollToBottom = sumHeight > panel.ActualHeight;
}
this.gridView.BeginInsert();
if (requestScrollToBottom)
{
scrollViewer.ScrollToBottom();
}
}
When selecting a Cell using the Mouse, the BorderColor is different to when navigating via ArrowKeys.
Also it seems that the Property IsSynchronizedWithCurrentItem does not work correctly when using ArrowKeys.
The issue with the Color can be observed in the Demo
Hi
I have a grid where some rows contain child rows. In order to control which rows have the "+" expander icon I use the IsExpandableBinding property. I also have a toolbar which contains a convenience button to collapse all the expanded rows.
This button is bound to a handler which called RasGridView.CollapseAllHierarchyItems(), but this does not have any effect. I've tried removing the IsExpandableBinding property, and the collapse mechanism then works (but I get unwanted expanders on every row).
Hi,
I am currently having issues with RadGridView's group footer: I am trying to add a button to the footer template which is supposed to trigger a command which in turn needs some info on the group it was triggered from*.
Since (unlike the header) there does not seem to be any info on the group available directly within the GroupFooterTemplate, I am pulling the group info from the parent GridViewGroupFooterRow:
<telerik:GridViewDataColumn [...]>
<telerik:GridViewColumn.GroupFooterTemplate>
<DataTemplate>
<Button Command="{Binding DataContext.ShowFooterGroupCommand, RelativeSource={RelativeSource AncestorType=telerik:RadGridView}}"
CommandParameter="{Binding Group.Key, RelativeSource={RelativeSource AncestorType=telerik:GridViewGroupFooterRow}}" />
</DataTemplate>
</telerik:GridViewColumn.GroupFooterTemplate>
</telerik:GridViewDataColumn>
This is working great as long as the RadGridView does not use Row virtualization. However, when I turn on Row virtualization and scroll around for a bit, the value I get passed as the CommandParameter is more or less random and has nothing to do with the group my button is actually located in.
I attached a small example project (.Net 6 but our app uses 4.8 so I set that as the Framework below) for you to try it yourself. Just scroll around and click the buttons while watching the debug output window. You will see that the groups in the output window will not match the group where you actually clicked the button after some scrolling.
Even when virtualizing, the Group key returned when binding to GridViewGroupFooterRow.Group(.Key) should reliably return the key of the actual group my button is placed in. It would be even better if it was somehow possible to get the group directly, without having to resort to FindAncestor.
Regards
Simon Müller
Hofmann Fördertechnik GmbH
* Basically I am trying to give the user a possibility to add new items to the individual groups and I don't want to add the button to the group header since that makes it too easy to accidentally hit the header's RadToggleButton, collapsing the group.
The SelectedCells collection of RadGridView contains wrong cells in a scenario where the previous selection is cleared and then its items are filtered out of the view. This reproduces with SelectionMode set to Extended and SelectionUnit set to Mixed.
This happens if you call gridView.SelectedItems.Clear() or gridView.UnselectAll(). You can work around the issue if you clear the SelectedCells. To do so, call also gridView.SelectedCells.Clear().gridView.SelectedCells.Clear();
The issue appears when you have two adjacent columns - one resizable on the left and one not-resizable (IsResizing=False) on the right. If you hide the left column (IsVisible=False), the resize handle of the right column is still there and it can be used to resize it.
To work this around, you can remove the next column and add it again in the Columns collection, after you hide the previous column.
this.gridView.Columns[1].IsVisible ^= true;
var nextColumn = this.gridView.Columns[2];
this.gridView.Columns.Remove(nextColumn);
this.gridView.Columns.Add(nextColumn);
RadGridView throws error 'DataGrid_DisplayIndexOutOfRange Parameter name: displayIndex'
when SelectionUnit is set to Mixed
SelectionUnit = "FullRow" and SelectionUnit="Cell" works fine.
Please find attached solution for crash.
Telerik version which we are using is UI for WPF 2021
In attached demo from list of data Select any item and click on isolate button above or apply filter from column filter dialog. it throws this error
at Telerik.Windows.Controls.GridView.GridViewDataControl.ColumnFromDisplayIndex(Int32 displayIndex)
Currently, to modify the background color of this element, the default control template of the GridViewCell element needs to be extracted, and the VisualState with x:Name="Highlighted" would need to be customized.
We could include an API for modifying the background color of the HighlightTextBlock element, when it is highlighted.
Some of the rows of the RadGridView control are missing, when placed inside a RadPane and one of the newer themes is set via StyleManager.
As a workaround, set the UseLayoutRounding property of the RadGridView control to False.
The GridView allows you to drag-to-reorder its columns. When start dragging the clicked element is accessed and a screenshot is made from it. Then the drag visual shows an image of the dragged column header. In some cases the drag visual gets clipped.
To work this around, you can subscribe the GridViewHeaderCell elements to the DragDropManager's DragInitialize event and replace the default drag visual with a custom one.
private void RadGridView_CellLoaded(object sender, Telerik.Windows.Controls.GridView.CellEventArgs e)
{
if (e.Cell is GridViewHeaderCell)
{
Dispatcher.BeginInvoke(new Action(() =>
{
DragDropManager.AddDragInitializeHandler(e.Cell, OnHeaderCellDragInitialize, true);
}));
}
}
private void RadGridView_CellUnloaded(object sender, Telerik.Windows.Controls.GridView.CellEventArgs e)
{
if (e.Cell is GridViewHeaderCell)
{
Dispatcher.BeginInvoke(new Action(() =>
{
DragDropManager.RemoveDragInitializeHandler(e.Cell, OnHeaderCellDragInitialize);
}));
}
}
private void OnHeaderCellDragInitialize(object sender, DragInitializeEventArgs e)
{
var dragSource = e.OriginalSource as GridViewHeaderCell;
if (dragSource != null)
{
var dragVisual = new Border()
{
BorderBrush = Brushes.LightGray,
BorderThickness = new Thickness(1),
Background = new SolidColorBrush(Colors.Bisque) { Opacity = 0.4 },
Width = dragSource.ActualWidth,
Height = dragSource.ActualHeight,
Child = new TextBlock()
{
Text = (string)dragSource.Column.Header,
Margin = new Thickness(5, 0, 5, 0),
VerticalAlignment = VerticalAlignment.Center }
};
e.DragVisual = dragVisual;
}
}