Ask a Question

Exist a way to use Find Method without PropNames, only with PropValues?

Occasional Contributor

Exist a way to use Find Method without PropNames, only with PropValues?



Hello, exist a way where I can use Find Method, without check in source code the Property Name? Lets check the following example, in a grid of Delphi Application:

I don't know the property name, but making manual test I see the text <Sem dados para exibir> inside the grid.




Reading documentation we can see the:

PropNames [in]    Required    Variant    
PropValues [in]    Required    Variant    


But only in PropValues we can use special char * or ? and regular expressions:

"Values can contain asterisk (*) or question mark (?) wildcards, or regular expressions. The asterisk (*) wildcard corresponds to a string of any length (including an empty string), the question mark corresponds to any single character (including none). To specify more complicated parts of the value, use regular expressions."

Occasional Contributor

My solution is check (...).grid.ActiveView.ViewData.RecordCount, and check if RecordCount == 0, I just curious about if is possible Find by Text in delphi desktop applications to improve my tests.




I think that your current approach is way better then search by text and no, it is not possible to use .Find() without property names.


P.S. For me this seems to be logical - object itself does not contain any text but only object property can contain some text. What property to consider when searching for the text? So you will need to iterate through all or some of properties. I believe that you can write such iterator yourself if you really need it. Also, it is quite possible that the text that you see does not belong to the grid but is some another object created and displayed by grid when it is empty.


  /Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
Showing results for 
Search instead for 
Did you mean: