C sharp - Filtrar dataGridView con otro - C#

 
Vista:
sin imagen de perfil

Filtrar dataGridView con otro - C#

Publicado por Juan Pedro (3 intervenciones) el 30/03/2015 19:24:14
Buenas tardes,

Intento filtrar un DataGridView usando la selección de otro, pero algo ocurre, el evento de clicar a la celda no ocurre nada.
Aquí el código que he usado.
Los msgbox para ver donde se queda, no se muestran al clicar:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
private void isodgv_CellContentClick(Object sender, DataGridViewCellEventArgs e)
{
    MessageBox.Show("sd");
    if (e.RowIndex >= 0)
    {
        MessageBox.Show("");
        DataGridViewRow row = this.isodgv.Rows[e.RowIndex];
 
 
        OleDbConnection con = new OleDbConnection(datString);
        con.Open();
        OleDbCommand cmm = new OleDbCommand("SELECT Id_Nombre FROM Isometricos WHERE Nombre = '" + row.Cells["Nombre"] + "'", con);
        OleDbDataReader leer = cmm.ExecuteReader();
        int iso = Convert.ToInt16(leer["Id_Nombre"].ToString());
 
        OleDbDataAdapter a = new OleDbDataAdapter("SELECT * FROM UnionesCons WHERE Id_Nombre =" + iso, con);
        DataTable tbl = new DataTable();
        a.Fill(tbl);
        dataGridView5.DataSource = tbl;
        con.Close();
 
 
    }
    else MessageBox.Show("no hay registro");
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder