Devexpress delete a row
Using DevExpress's Grid, what the easiest way to implement a delete of a selection of rows from the UI only. The desired behavior is for the user 开发者_如何学编程to multi-select rows then press DEL.
I have enabled editing and multi-select.
From Devexpress Support Center and assuming that you are referring to a Windows Form Grid:
To delete multiple selected rows use the GridView.DeleteSelectedRows method. If you need to conditionally protect some rows from deletion, iterate through the GridView.SelectedRows array, and unselect certain rows using the GridView.UnselectRow method.
How to delete the multiple rows in the grid?
You also need to handle the key down event of the grid if you want to delete the selected rows on a key press.
If it's not Windows Forms you can search their Support Center by product. From my experience the technical support there is very nice.
The method that I use generally is,
GridView.DeleteRow(GridView.FocusedRowHandle)
It works well.
精彩评论