Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Estoy haciendo un programa de alta, baja y modificación en c#.
Necesito que a través de un evento cellclick de un DataGridView se completen los campos que tengo.
Google Translate:
I am doing a high, low and modification program in c #.
I need that through a cellclick event of a DataGridView the fields that I have are completed.

C#
private void dgvproductos_CellClick(object sender, DataGridViewCellEventArgs e)
{
    id = dgvproductos.CurrentRow.Cells[0].Value.ToString();
    autocompletar();

 }
EL comboBox se llama cbxcategoria
Google Translate:
The comboBox is called cbxcategory

C#
foreach (DataRow fila in consulta.Rows)
{
    txbnombre.Text = fila[1].ToString();
    txbcodigo.Text = fila[0].ToString();
    txbprecio.Text = fila[2].ToString();
    cbxcategoria =
}


What I have tried:

Necesito saber como cargarle los datos al comboBox
Google Tr:
I need to know how to load the data to the comboBox
Posted
Updated 8-Nov-21 20:37pm
v2
Comments
OriginalGriff 9-Nov-21 2:38am    
This is an English language site, and we can only accept and answer questions in that language.
I have run this through Google Translate to produce a probably-good version, but you should check it and make sure it does say what you are actually asking.
j snooze 11-Nov-21 17:23pm    
You might be looking to set the datasource of the combo box if you have a list collection/data table of the possible values for your combo box. Then look for using the value and display properties so you know which value to grab while displaying a user friendly description for the user. If I read the problem correctly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900