C1TreeView search and searchAll for Text

Posted by: saidnai on 11 January 2024, 2:32 am EST

    • Post Options:
    • Link

    Posted 11 January 2024, 2:32 am EST

    HI,

    I used the following code as described to search a text in the C1TreeView:

    C1TreeView1.SearchAll(Text)

    The search is working only with the exact value of the node but not with only a part of it.

    is there away to use (Search/SearchAll) with only a prt of the node value?

    Best regards

    Said

  • Posted 11 January 2024, 5:40 pm EST

    Hi Said,

    To search for only a part of the node value, you can pass the ComparisonType.Contains value to the comparisonType parameter of the Search/SearchAll methods. Please see the attached sample project for reference.

    TreeViewSearch.zip

    Best Regards,

    Kartik

  • Posted 12 January 2024, 12:58 am EST

    Hi Kartik,

    I convert the function from C# to VB and it works.

    Next question how to continue searching the next nodes?

    Best regards & Thanks

    Said

  • Posted 14 January 2024, 4:44 pm EST

    Hi Said,

    The C1TreeView.Search method only shows and highlights the first node that matches the searched string. If you want to show and highlight all the nodes that match your search string, you can use the C1TreeView.SearchAll method.

    Please note that the SearchAll method will only show and highlight all the matched nodes if you have set the C1TreeView.SelectionMode = C1TreeViewSelectionMode.Multi. We have attached the updated sample project showing the working of both methods.

    TreeViewSearch.Updated.zip

    Thanks, and Best Regards,

    Kartik

  • Posted 14 January 2024, 6:37 pm EST

    Hi Kartik,

    It is working.

    Best regards

    Said

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels