您可以使用GridView.FocusedRowHandle属性:
view.DeleteRow(view.FocusedRowHandle);
You cannot access rows on GridControl
, since this is just a container for the views. As I can see from your picture you're using GridView
. When you press the delete button, focused row changes and you can access it via FocusedRowHandle
.
private void delete_button_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
var gv = myGridControl.MainView as GridView;
var index = gv.FocusedRowHandle;
gv.DeleteRow(index);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.