private void btnEditItemRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (this.ItemsGridView.GetFocusedRow() is PRDetails item) { frmAddEditPurchaseRequest frm = new frmAddEditPurchaseRequest(MethodType.Edit, item.PurchaseRequests); frm.ShowDialog(); } }