Hi,
I am trying to Delete a Row with the Delete Key from the KeyDown event. I have the DeleteKeyAction set to Delete Selected Rows (but have tried all 4 options) and I have RowSelection set to single but also tried multiple.
My problem is that the KeyDown event will only fire if I select a cell. It does not fire when I just have a row selected. I've included my grid loading and keydown event code.
Private Sub idgQuotesDetail_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles idgQuotesDetail.Loaded Me.idgQuotesDetail.SelectionSettings.RowSelection = Infragistics.Silverlight.SelectionType.Single Me.idgQuotesDetail.SelectionSettings.CellSelection = Infragistics.Silverlight.SelectionType.Single Me.idgQuotesDetail.RowSelectorSettings.Visibility = Windows.Visibility.Visible Me.idgQuotesDetail.DeleteKeyAction = Infragistics.Silverlight.DeleteKeyAction.DeleteSelectedRows Me.idgQuotesDetail.EditingSettings.AllowEditing = Infragistics.Silverlight.EditingType.Cell Me.idgQuotesDetail.EditingSettings.IsMouseActionEditingEnabled = Infragistics.Silverlight.MouseEditingAction.SingleClick Me.idgQuotesDetail.PagerSettings.AllowPaging = Infragistics.Silverlight.PagingLocation.Bottom Me.idgQuotesDetail.PagerSettings.PageSize = 6 Me.idgQuotesDetail.SortingSettings.AllowSorting = True Me.idgQuotesDetail.SortingSettings.AllowMultipleColumnSorting = True End Sub
Private Sub idgQuotesDetail_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs) Handles idgQuotesDetail.KeyDown Select Case e.Key Case Key.Insert AddNewQuoteDetail() Case Key.Delete DeleteCurrentRow() End Select End Sub
Is this a bug or am I missing something?
Thanks,
Lisa.
Hi Steve,
Vladimir responded through my support request. The problem is with the scroll viewer controlling the mousebutton event.
I was able to resolve the problem by calling the OnMouseLeftButtonDown handler in my page containing the grid and set e.handler to true.
Hi Lisa,
I apologize i was away on vacation.
However, i wasn't able to reproduce your issue with a Navigation Page.
Do you have a sample that you're using that you can send?
-SteveZ
Hi guys,
Is anyone going to look into this?
Will you have a chance to look at this soon? My only option now is to add a delete checkbox to my grids and since I need to bring this project to a close I have to make that decision soon.
Thanks for your code. I pared mine down to duplicate yours and the only way I could get it to work was to put my code in the MainPage as yours is, using the User Control. Mine is in a Navigation Page using the Page Control.
Can you please test in a Navigation Page to confirm whether or not the control is the problem?
Thanks!