workaround:
public MainWindow()
{
InitializeComponent();
this.grid.Loaded += grid_Loaded;
}
void grid_Loaded(object sender, RoutedEventArgs e)
{
this.grid.ChildrenOfType<Grid>().FirstOrDefault(x => x.Name == "PART_OuterGrid").RowDefinitions[1].Height = GridLength.Auto;
var cells = this.grid.ChildrenOfType<GridViewHeaderCell>();
foreach (GridViewHeaderCell cell in cells)
{
cell.ChildrenOfType<Grid>().FirstOrDefault(x => x.Name == "PART_OuterGrid").RowDefinitions[1].Height = GridLength.Auto;
}
}
The bug happens when we have two or more rows merged in the first column and programmatically, we make the rowDetails for the first row visible, the merged cells of the first column stay merged and are over of the rowDetails, hiding a part of the Row Details:
Hi Team,
We have a large-scale WPF application that uses the Telerik WPF RadGridView across multiple screens. We are experiencing significant memory growth issues. Upon deep analysis of the memory dump, we observed that the RadGridView continuously pushes DispatcherPriority items into the Dispatcher queue. We also noticed an internal timer within the RadGridView that appears to be active even after the control is no longer visible. We would like to understand how to completely detach and stop this internal timer once the control is removed from the screen, and why the RadGridView keeps pushing DispatcherItem entries into the Dispatcher queue.
Telerik Version : 2017.2.503.45
Bind a grid to a DataView
Start editing and change the values of a few cells.
Press Escape twice to cancel the edit of the entire row.
Expected: the values return to the old values
Actual: the values remain the last entered ones
When using an INotifyCollectionChanged (like ObservableCollection<T>), RadGridView's data engine subscribes to the CollectionChanged event of the bound collection.
It seems that the WPF views are recreated when you connect to a running remote desktop session or switch the user to a session where the corresponding WPF app is already opened. This creates new instances of all controls, but no unload or another disposal event happens. In this case, the logic that subscribes to the CollectionChanged event again is triggered for the new RadGridView, but the old one never detaches from the event. This causes a memory leak.
If you connect to the session multiple times, the CollectionChanged handler will be attached multiple times leading to a memory leak.
To work this around, set the ItemsSource of RadGridView to null in the SystemEvents.SessionChanged static event.
private void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
{
if (e.Reason == SessionSwitchReason.SessionLock)
{
BindingOperations.ClearAllBindings(this.RadGridViewFixed);
}
}