This is a migrated thread and some comments may be shown as answers.

Delete command stops working after first cell edit

4 Answers 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marius
Top achievements
Rank 1
Marius asked on 20 Dec 2010, 03:00 PM
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

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 21 Dec 2010, 12:48 PM
Hello Marius,

Getting out of edit mode is achieved through double clicking on the Esc button. So, if you just click it once, you are still in edit mode. 
Furthermore, indeed the deleting functionality is disabled after performing the described steps. However, everything works correctly with our Latest Internal Build binaries.
 

Greetings,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Marius
Top achievements
Rank 1
answered on 21 Dec 2010, 12:52 PM
I'm sorry, but I am still confused. If you click escape twice, the delete functionality is still not working, so I could have just written "press esc twice" and you would still be able to produce the same output. Are you saying that this is a bug and that its not reproducible in your latest internal build? If so, when can we expect to see a release which fixes this?
0
Accepted
Maya
Telerik team
answered on 21 Dec 2010, 12:57 PM
Hello Marius,

Please try out the sample project with the binaries from our Latest Internal Build. I have tested it and the delete functionality is working property after getting out of edit mode.
Furthermore, the release of our Service Pack is in a couple of days and it will contain the fix for your issue.
  

Best wishes,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Marius
Top achievements
Rank 1
answered on 21 Dec 2010, 01:03 PM
I've retested it with your latest binaries and I can confirm that the bug is fixed.
Tags
GridView
Asked by
Marius
Top achievements
Rank 1
Answers by
Maya
Telerik team
Marius
Top achievements
Rank 1
Share this question
or