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

How to handle custom row delete

3 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 04 Jan 2011, 09:28 PM
I have a DataGrid that is bound to a the Values in a ObservableDictionary (my own class) instead of the traditional ObservableCollection. Because of this, I cannot use the build in delete mechanism of the GridView.  I therefore need to implement my own custom delete behavior on the current selected row when the Delete button is pressed.

My problem is that I cannot get an event when the delete button is pressed.  Neither the Deleted, Deleting or KeyDown events for the DataGrid is firing.  The CanUserDeleteRows property is set to true.

How can I get an event to fire when the Delete key is pressed?

 

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 05 Jan 2011, 09:26 AM
Hello Stefan,

You can try defining your own custom keyboard command provider as shown here.

Hope this helps.

All the best,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Nargis
Top achievements
Rank 1
answered on 27 Aug 2014, 08:20 AM
Hello,

I'm new here and hope I'm posting in the right thread.
I'm implentig an WPF Application using Telerik UI. I have also a DataGrid that is bound to the Values in a ObservableDictionary (self implemented).
Actually a blank line is always present. The default message "click to add a new row" is removed by me. The position also defined by

myGridView.NewRowPosition = Telerik.Windows.Controls.GridView.GridViewNewRowPosition.Bottom;

The blank line must be appear if the user explicitly clicks an add button.
If I use the ObservableCollection it works as desired. How could I achieve this behavior by using ObservableDictionary?

Thanks a lot in advance!
0
Dimitrina
Telerik team
answered on 29 Aug 2014, 01:44 PM
Hi,

Would you please open a new support ticket on the problem and send us a demo project illustrating the issue when you use your custom ObservableDictionary collection?

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Stefan
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Nargis
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or