Find method cache in TreeListControl
Hi,
Problem description
I'm using test complete to test my WPF Application. I need to identify a row in a DevExpress.Xpf.Grid.TreeListControl using the field 'DisplayValue'. I'm currently using the .Find() method as follows:
<SPAN class="token punctuation">.</SPAN><SPAN class="token function">Find</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token string">"DisplayText"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"Single Elements"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token number">5</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token boolean">true</SPAN><SPAN class="token punctuation">)</SPAN>
After the app startup, everything works fine and the row can be found properly but when change is performed on the TreeListControl (for example a new row is added), the find function always returns the same object. Since the TreeListControl has changed, the row containing "Single Elements" no longer has the same RowControl index.
Screenshots illustrating the problem
Before the changes in the TreeListControl
In this scenario, the RowControl containing the "Single Elements" is N°5 (see screenshot). The Find method returns an object which path contain a reference to RowControl N°5 as expected. Everything works fine.
After the changes in the TreeListControl
Now an element has been added to the TreeListControl. The "Single Elements" row has index N°6. The Find method still returns an object which path contain a reference to RowControl N°5.
Question
- What can explain this behavior?
- Is there a way to force the cached TreeListControl to be cleared?
Thank you in advance !
Hi ! Sometimes the refresh parameter of the Find method doesn't work properly. In this case, I'm retrieving a parent object from the tree and specifically performing a refresh on that object. (this will refresh all child objects).