private void dtgData_CellContentClick(object sender, DataGridViewCellEventArgs e) { FormConsultaPrestamosDetalle frm = new FormConsultaPrestamosDetalle(); string prestamoId = "0"; try { this.Cursor = Cursors.WaitCursor; if (dtgData.Columns[e.ColumnIndex] is DataGridViewLinkColumn && e.RowIndex >= 0) { prestamoId = dtgData["Prestamo_Id", dtgData.CurrentRow.Index].Value.ToString(); frm.prestamoId = prestamoId; frm.ShowDialog(); } } catch (Exception ex) { objUtil.MostrarMensajeError(ex.Message); } finally { frm.Dispose(); this.Cursor = Cursors.Default; } }
private void dtgPrestamos_CellContentClick(object sender, DataGridViewCellEventArgs e) { FormConsultaPrestamosDetalle frm = new FormConsultaPrestamosDetalle(); string valorUnico = "0"; DataRow MyFila = null; string prestamoId = "0"; try { this.Cursor = Cursors.WaitCursor; var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewLinkColumn && e.RowIndex >= 0) { valorUnico = dtgPrestamos["unico", dtgPrestamos.CurrentRow.Index].Value.ToString(); MyFila = DTPrestamos.Select("Unico = " + valorUnico)[0]; prestamoId = util.GetAsString("Prestamo_Id", MyFila, "0"); frm.prestamoId = prestamoId; frm.ShowDialog(); } } catch (Exception ex) { util.MostrarMensajeError(ex.Message); } finally { this.Cursor = Cursors.Default; frm.Dispose(); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { string valorUnico; DataRow myFila; FormConsultaPrestamosDetalle frm = new FormConsultaPrestamosDetalle(); try { this.Cursor = Cursors.WaitCursor; var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewLinkColumn && e.RowIndex >= 0) { //TODO - Button Clicked - Execute Code Here valorUnico = senderGrid["unico", senderGrid.CurrentRow.Index].Value.ToString(); //BUSCO LA FILA SELECCIONADA POS SU UNICO myFila = MyData.Select("Unico = " + valorUnico.ToString())[0]; frm.prestamoId = myFila["Prestamo_Id"].ToString(); frm.nombreUsuario = nombreUsuario; frm.ShowDialog(); } } catch (Exception ex) { objUtil.MostrarMensajeError(ex.Message); } finally { this.Cursor = Cursors.Default; frm = null; myFila = null; } }