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;
}
}
When GridViewClipboardPasteMode is set to AllSelectedCells and a single clipboard value is pasted into more than one selected cell, RadGridView updates the cell values but does not re-evaluate live grouping for the edited items - rows remain under their previous group header until an explicit Rebind()/refresh.
Pasting into a single cell at a time re-groups correctly.
To work this around, call the CommitEdit and EditItem methods of RadGridView for each row data item in which data was pasted. You can do that in the Pasted event handler:
private void RadGridView_Pasted(object sender, RadRoutedEventArgs e)
{
var editableView = (IEditableCollectionView)this.gridView.Items;
var affectedItems = this.gridView.SelectedCells.Select(c => c.Item).Distinct().ToList();
foreach (var item in affectedItems)
{
editableView.EditItem(item);
editableView.CommitEdit();
}
}
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);
}
}
Currently, the delimiter is hardcoded to ",". Add a setting that allows changing this and also synchronizing it with the current culture of the system.
In the case where some of the columns are hidden and all of the columns' display indexes are changed, applying grouping could result in some of the cells from the columns that have custom CellTemplate to not receive it.
To work this around, you could manually change the widths of the columns by iterating the Columns collection as shown below:
foreach (var column in this.GridView.Columns)
{
GridViewLength length = column.Width;
if (length.IsAbsolute)
{
column.Width = new GridViewLength(length.Value + 0.00001);
}
}
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.
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.
The Clear Filters option in the FieldFilterControl cannot be selected when the DefaultOperator1 is set in the FilterOperatorsLoading event of RadGridView. The FieldFilterControl is the element shown under the column header when the FilteringMode property of RadGridView is set to FilterRow. Setting e.DefaulteOperator1 in the FilterOperatorsLoading properly selects the corresponding filter in the drop down, but after that you cannot select Clear Filters when clicking on this option.
To work this around, you can use the CellLoaded event instead of FilterOperatorsLoading. This will allow you to get the FieldFilterControlViewModel and set its SelectedOperatorViewModel property.
private void manualGridView_CellLoaded(object sender, CellEventArgs e)
{
if (e.Cell is GridViewHeaderCell && e.Cell.Column.UniqueName == "MyColumn")
{
Dispatcher.BeginInvoke(new Action(() =>
{
var fieldFilter = e.Cell.FindChildByType<FieldFilterControl>();
var viewModel = (FieldFilterControlViewModel)fieldFilter.DataContext;
viewModel.SelectedOperatorViewModel = viewModel.AvailableOperatorViewModels.FirstOrDefault(x => x.FilterOperator == FilterOperator.IsLessThan);
}));
}
}