The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
VS2005 does not have a DataGrid, it uses the new DataGridView. I''m looking for code that will allow me to delete multiple rows from the DataGridView and which method/event I should place the code. I would like the users to do this by pressing the DEL key. Any ideas/suggestion appreciated.
STstanleyj Syncfusion Team February 23, 2006 06:29 AM UTC
Hi LarryBye,
If you have the row header, clicking it selects the rows then the Del key removes the rows. Is that not sufficient?
Regards,
Stanley
LALarryByeFebruary 23, 2006 04:55 PM UTC
Here is how I ending up handling it. I trapped the key down forr the "delete" key
Private Sub dgBadData_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles dgBadData.KeyDown
If e.KeyCode = Keys.Delete Then
If MessageBox.Show("Are you sure you want to delete the selected record(s)?", _
"Delete Record", MessageBoxButtons.YesNo, MessageBoxIcon.Question, _
MessageBoxDefaultButton.Button2) = Windows.Forms.DialogResult.No Then
e.Handled = True
End If
End If
End Sub
Then if the user says "yes" then I used the UserDeleteRow:
Private Sub dgBadData_UserDeletedRow(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowEventArgs) Handles dgBadData.UserDeletedRow
Me.TblACBadDataTableAdapter.Update(AirClicDataSet)
Me.lblRowCount.Text = "Total Records: " & dgBadData.RowCount
End Sub
ADAdministrator Syncfusion Team September 1, 2006 08:55 AM UTC
u can keep a list of deleted items. When u catch a delete event u should add the current row information to that list and then delete that object from the database
>VS2005 does not have a DataGrid, it uses the new DataGridView. I''m looking for code that will allow me to delete multiple rows from the DataGridView and which method/event I should place the code. I would like the users to do this by pressing the DEL key. Any ideas/suggestion appreciated.