public FrmCompraRixtyV2(RixtyProductDetails data) { InitializeComponent(); txtProductCode.Text = data.ProductCode; txtPreco.Text = data.UnitPrice; txtProd.Text = data.ProductName; txtQuantity.Text = "1"; this.data = data; }
private void dgProdutos_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { var row = senderGrid.Rows[e.RowIndex]; var details = new RixtyProductDetails { ProductName = row.Cells[0].Value.ToString(), ProductDescription = row.Cells[1].Value.ToString(), ProductCode = row.Cells[2].Value.ToString(), IsStockAvailable = row.Cells[3].Value.ToString(), Commission = row.Cells[4].Value.ToString(), SellingPrice = row.Cells[5].Value.ToString(), UnitPrice = row.Cells[6].Value.ToString() }; var frm = new FrmCompraRixtyV2(details); frm.ShowDialog(); } }