They could help me to solve this error, it works in a normal datagridview
, but in this it does not work, in this datagridview
I select any data and it puts it in texbox
.
It works in this way so that you can understand me a little better:
When selecting any data from the datagridview, it shows me in the textbox
but when wanting to sort the data either by invoice number or by client name, the following error marks me, only the ordering by ID
works.
The error shows it to me in the code when I select any data from datagridview
to send it to the fields of texbox
that belongs
this is the code:
private void dataGridViewCatalogoPartes_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
txtId.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[0].Value.ToString();
txtnumfactura.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[1].Value.ToString();
txtCliente.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[2].Value.ToString();
txtparte.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[3].Value.ToString();
comboBoxTipoMaterial.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[4].Value.ToString();
txtDescripcionEspañol.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[5].Value.ToString();
txtDescripcionIngles.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[6].Value.ToString();
txtCantidad.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[7].Value.ToString();
txtPrecioUnitario.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[8].Value.ToString();
txtpallet.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[10].Value.ToString();
txtobservaciones.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[11].Value.ToString();
comboBoxPais.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[12].Value.ToString();
txtpesopallet.Text = this.dataGridViewCatalogoPartes.Rows[e.RowIndex].Cells[13].Value.ToString();
}