There seems to be a bug in the RadGridView. If I select the grid and press the delete shortcut key, the selected row is removed from the grid. If I edit a cell before trying to select a row and deleting it; the delete shortcut stops working (pressing it has no effect). The grid is bound to a BindingList. I have noticed the same effect on two different grids, I've also noticed that if I remove an item from the bound collection, the radgridview updates as expected (its just the delete shortcut which is gone). Is this a known issue, and are there any workarounds for it?
I've also created a custom command provider and observed that the delete command is being created and sent to the grid after the del key is pressed.
Update:
I've managed to reproduce this in a small test project.
This is what I bound to:
internal class ViewModel
{
private readonly BindingList<Item> _items = new BindingList<Item>();
public ViewModel()
{
_items.Add(new Item{ A = "First item", B = "howdy"});
_items.Add(new Item { A = "Second item", B = "doodle" });
}
public BindingList<Item> Items
{
get { return _items; }
}
}
}
This is the view:
<Window x:Class="TelerikWpfBugs.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<Window.Resources>
<Style TargetType="telerik:RadGridView">
<Setter Property="AutoGenerateColumns" Value="False"></Setter>
<Setter Property="KeyboardNavigation.TabNavigation" Value="Continue"></Setter>
<Setter Property="telerik:StyleManager.Theme" Value="Office_Blue"></Setter>
<Setter Property="ShowGroupPanel" Value="False"></Setter>
<Setter Property="ShowColumnHeaders" Value="False"></Setter>
<Setter Property="RowIndicatorVisibility" Value="Collapsed"></Setter>
<Setter Property="IsFilteringAllowed" Value="false"></Setter>
</Style>
</Window.Resources>
<Grid>
<telerik:RadGridView ItemsSource="{Binding Items}" ShowInsertRow="true">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="A" DataMemberBinding="{Binding A}"></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="B" DataMemberBinding="{Binding B}"></telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</Window>
3. Just set the viewmodel as the datacontext for the window upon initialization.
Steps to reproduce (i'm using the wpf q2 2010 sp2 release) :
1. Start test project, notice that you can select rows and delete them
2. Restart test project, double click on a cell to put it into edit mode
3. Go out of edit mode by pressing "escape"
4. Try hitting the del key, the selected row will not be deleted.
I've submitted a support ticket on the issue: 378153
I've also created a custom command provider and observed that the delete command is being created and sent to the grid after the del key is pressed.
Update:
I've managed to reproduce this in a small test project.
This is what I bound to:
internal class ViewModel
{
private readonly BindingList<Item> _items = new BindingList<Item>();
public ViewModel()
{
_items.Add(new Item{ A = "First item", B = "howdy"});
_items.Add(new Item { A = "Second item", B = "doodle" });
}
public BindingList<Item> Items
{
get { return _items; }
}
}
}
This is the view:
<Window x:Class="TelerikWpfBugs.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<Window.Resources>
<Style TargetType="telerik:RadGridView">
<Setter Property="AutoGenerateColumns" Value="False"></Setter>
<Setter Property="KeyboardNavigation.TabNavigation" Value="Continue"></Setter>
<Setter Property="telerik:StyleManager.Theme" Value="Office_Blue"></Setter>
<Setter Property="ShowGroupPanel" Value="False"></Setter>
<Setter Property="ShowColumnHeaders" Value="False"></Setter>
<Setter Property="RowIndicatorVisibility" Value="Collapsed"></Setter>
<Setter Property="IsFilteringAllowed" Value="false"></Setter>
</Style>
</Window.Resources>
<Grid>
<telerik:RadGridView ItemsSource="{Binding Items}" ShowInsertRow="true">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="A" DataMemberBinding="{Binding A}"></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="B" DataMemberBinding="{Binding B}"></telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</Window>
3. Just set the viewmodel as the datacontext for the window upon initialization.
Steps to reproduce (i'm using the wpf q2 2010 sp2 release) :
1. Start test project, notice that you can select rows and delete them
2. Restart test project, double click on a cell to put it into edit mode
3. Go out of edit mode by pressing "escape"
4. Try hitting the del key, the selected row will not be deleted.
I've submitted a support ticket on the issue: 378153