private void gridControl1_DoubleClick_1(object sender, EventArgs e) { if (VendorGridView.SelectedRowsCount > 0) { var selected = (VendorInfo)VendorGridView.GetRow((int)VendorGridView.GetSelectedRows().GetValue(0)); if (selected != null) { _venldor = _context.Vendors.First(ven => ven.VendorId == selected.VendorId); } } OpenSelectedItem(); }
private void gridControl1_Click(object sender, EventArgs e) { if (VendorGridView.SelectedRowsCount > 0) { var selected = (VendorInfo)VendorGridView.GetRow((int)VendorGridView.GetSelectedRows().GetValue(0)); if (selected != null) { _venldor = _context.Vendors.FirstOrDefault(ven => ven.VendorId == selected.VendorId); btnDelete.Enabled = true; } } AuthorizeForm(); }
public object GetSelectedItem() { Vendor vendor = null; if (VendorGridView.SelectedRowsCount > 0) { var selected = (VendorInfo)VendorGridView.GetRow((int)VendorGridView.GetSelectedRows().GetValue(0)); if (null != selected) { _venldor = _context.Vendors.First(vn => vn.VendorId == selected.VendorId); } } return(vendor); }