1:FunctionPesquisa(QualGridAs DataGridView, PesquisaAs String)As Boolean2:DimstrAs String3:4:DimResAs Boolean= False 5:For EachlinhaAsDataGridViewRowInQualGrid.Rows 6:If Notlinha.IsNewRowThen7: str = UCase(linha.Cells("PROPRIEDADE_NAME_DA_COLUNA_DO_GRID").Value.ToString) 8:Ifstr.Contains(Pesquisa.ToUpper)Then9: QualGrid.CurrentCell = linha.Cells("PROPRIEDADE_NAME_DA_COLUNA_DO_GRID") 10:'Achou11: Res =True12:End If13:Else14:'Não Achou15: Res =False16:End If17:Next18:Return(Res) 19:End Function
Para chamar esta função;
1:IfPesquisa(DataGridView1, "João") =True Then2:End If
Lembrando quem irá selecionar a linha se acha-la.
Vlw, obrigadooo!!!
ResponderExcluir