Buen día.
deseo Buscar datos en un datagridview Filtrados mediante un ComboBox el cual me da a elegir el nombre de la columna y un TextBox el cual me da el dato a buscar:
Mi código es el siguiente:
Private Sub buscador() Dim indiceColumna As Integer = 0 If cb_Campo.Text = "Codigo Predio" Then indiceColumna = 0 End If If cb_Campo.Text = "Fecha" Then indiceColumna = 1 End If If cb_Campo.Text = "Valor Avaluo Actual" Then indiceColumna = 2 End If If cb_Campo.Text = "Tipo Notificacion" Then indiceColumna = 3 End If For Each row As DataGridViewRow In DataGridViewPredios.Rows If CStr(row.Cells(indiceColumna).Value).ToLower = txt_Buscar.Text.ToLower Then row.Selected = True Exit For End If Next End Sub
JorgeLeonardoDC