private void BtnAgregar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { //validar que el paquete este seleccionado if (this.slkupPaquete.EditValue != null) { DataRowView dr = (DataRowView)this.slkupPaquete.GetSelectedDataRow(); if (dr["Transaccion"].ToString() == "VT") { MessageBox.Show("No se puede crear un paquete de tipo venta desde el modulo de inventario"); return; } int IDPaquete = (int)this.slkupPaquete.EditValue; frmDocumentoInv ofrmDocumento = new frmDocumentoInv(IDPaquete); ofrmDocumento.ShowDialog(); } else { MessageBox.Show("Por favor seleccione un paquete, para poder agregar el documento."); } }