Forum Discussion

rshahwan's avatar
rshahwan
Occasional Contributor
13 years ago

WinForm DevExpress Filter Control Objects Mapping

Hi



Have anyone used WinForm DevExpress Filter Control? We are using this control to allow users to create filters in graphical form.



How does testcomplete idenify Filter Control objects? How can i let it select the column to filter on and filter condition and filter value?



please use  GridMainDemo application to demonstrate how to use Filter Control in testComplete



Attached, pleasescreenshot of the filter control i need help with



Your help is highly appreciated



Thanks



Rami


6 Replies

  • Anonymous's avatar
    Anonymous

    Hi Rami,





    To test the GridFilterControl control, you need to use its native properties and methods. For example, you can use the FilterString property of the control to obtain the contents of the filter editor. Please read the "Working With Application Objects and Controls" article to learn how to use the control's methods and properties.
  • rshahwan's avatar
    rshahwan
    Occasional Contributor
    I saw an example about that where i build the fitler string and set it to the grid filter property. This is suffecient to test if the filter has been applied. It is very important to me to test building the filter expression from the GUI control.



    I would like testcomplete to open the filter control and build filter like



    DisplayStr begins with Timer.



    Where DisplayStr is a grid column

    begins with  is an operator

    and Timer is a value



    Do you have and example for that? Would i be able to set this filter expression using native properties?



    I would appreciate the help



    Thanks



    Rami
  • Anonymous's avatar
    Anonymous

    Hi Rami,





    We can try to create a sample script for you. However, please note that this can take some time.


  • rshahwan's avatar
    rshahwan
    Occasional Contributor
    thanks, i would appreciate that . please keep me posted



    Rami
  • Anonymous's avatar
    Anonymous
    Hi Rami,




    We couldn't find a reliable way to test the filter editor via GUI.


    I offer you a way I have already specified to configure a reliable test for your grid. One more way to set the filter is to use the gridControl.FilterView.ActiveFilterString property and assign the string you need directly - this should be much faster and more reliable than simulating user actions. Considering the fact you don't need to test the built-in functionality of the grid control itself, this can be a better approach (at least, that's the approach I would use if I were you). This, however, will require knowing the filter strings syntax. It should be easy to figure it out by setting the criteria you need and looking at corresponding filter strings which appear as values of the gridControl.FilterView.ActiveFilterString property. We have a sample script demonstrating this approach in this How To article.