Hi,
i want to remove a batch of rows with a single confirmation dialog. Currently im using the RowsChaning event, but this fires for every deleted row, so the confirmation dialog pops up every time.
Is it possible to do a batch remove with a single dialog?
Winforms Q3 2009
Grid settings: MultipleSelect=true
Event used currently: RowsChaning
Datasource = bindinglist(of ...)
Here is my code:
----------------------
Greetings Falk
i want to remove a batch of rows with a single confirmation dialog. Currently im using the RowsChaning event, but this fires for every deleted row, so the confirmation dialog pops up every time.
Is it possible to do a batch remove with a single dialog?
Winforms Q3 2009
Grid settings: MultipleSelect=true
Event used currently: RowsChaning
Datasource = bindinglist(of ...)
Here is my code:
----------------------
Private |
Sub gvMails_RowsChanging(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCollectionChangingEventArgs) Handles gvMails.RowsChanging |
If |
e.Action = Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove Then |
If gvMails.SelectedRows.Count = 1 Then |
e.Cancel = |
Not DeleteMessageBox(gvMails.SelectedRows(0).DataBoundItem) |
Else |
e.Cancel = |
Not DeleteMessageBox() |
End If |
End If |
End Sub |
Private |
Function DeleteMessageBox() As Boolean |
If MsgBox("Delete all?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then |
For |
Each itm In gvMails.SelectedRows |
' delete single msg |
Next |
return True |
End If |
Return False |
End |
Function |
Private |
Function DeleteMessageBox(ByVal msg As Message) As Boolean |
If MsgBox("Delete single """ & msg.Subject & """?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then |
' delete single msg |
return True |
End If |
Return False |
End Function |
Greetings Falk