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;
}
}
The property changed of the property bound to IsExpandableBinding (property of RadGridView) is not reflected in the row. To reproduce this the IsPropertyChangedAggregationEnabled property of RadGridView should be set to True (which is the default value) and the view model property (bound to IsExpandableBinding) should be updated consequently with other properties of the view model. For example:
myRowModel.Name = "New name";
myRowModel.IsExpandable = false;
To work this around, use the IsExpandable property of GridViewRow. You can data bind it using the RowStyle property of RadGridView. Or alternatively, set the IsPropertyChangedAggregationEnabled property of RadGridView to False.
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.
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.
Opening the filter control of the RadGridView control with Xaml binaries in certain themes will throw the following exception:
​System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.'
Exception: Cannot find resource named 'NullToVisibilityConverter'. Resource names are case-sensitive.
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).
Currently, the range of the ScaleFactor property is between 0.1 and 4.0. We could include API to allow the user to set minimum and maximum boundaries that are between the default range (0.1 and 4.0).
For example:
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)
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);
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();
Especiall for wide lists it would be very helpful to be able to zoom in and out of a RadGridView, in order to see more or less columns. Also see: http://www.telerik.com/forums/scaling-of-radgridview-content