FlexGrid Search Highlight Behaviour

Posted by: james on 10 December 2024, 12:42 am EST

    • Post Options:
    • Link

    Posted 10 December 2024, 12:42 am EST - Updated 10 December 2024, 12:47 am EST

    Hi

    I’ve attached a sample, and also a screenshot of an issue with the highlighting of search results with FlexGrid.

    If you search for two words, such as “Name”+“Test”,

    • search works correctly, where it only returns the rows that contain both the words name and test
    • if words are in separate columns, then highlighting works correctly for those columns (it highlights both words).
    • if the two words are in the same column, it only highlights the last word.

    As mentioned, it does filter correctly, for example, if you have filtering turned on, then it will only return the rows that have both words. It is just highlighting that is exhibiting this weird behaviour.

    FlexGridSearchHighlightTest.zip

  • Posted 10 December 2024, 5:52 am EST

    Hello,

    Thank you for sharing the sample. We were able to observe the behavior. We noticed that if we pass space around the “+” character, the behavior does not occur.

    We have shared it with the development team for further insights. Rest assured, we’ll get back to you once we have got more information. [Internal tracking ID: C1WIN-33440]

    Regards,

    Uttkarsh.

  • Posted 20 December 2024, 2:14 am EST

    Hello,

    As per the team, you do not need to use ‘+’ char for searching multiple words in the grid; you can simply search for

    "Name""Test"
    or
    Name Test
    to get the desired results.

    However, if you still intend to use ‘+’ char, you can process your input string, modify it, and pass in the ApplySearch() method as follows:

    var text = textBox1.Text;
    var words = text.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries);
    c1FlexGridMultiRange.ApplySearch(string.Join("", words), SearchHighlightMode.All, true, true, true);

    Please refer to the attached sample for implementation. (see FlexGridSearchHighlightTest_Mod.zip)

    If there is any specific reason or use-case for using ‘+’ char, please share it with us.

    Regards,

    Uttkarsh.

  • Posted 16 January 2025, 11:54 pm EST - Updated 17 January 2025, 12:00 am EST

    (EDITED)

    Hi Uttkarsh

    Both “Name”“Test” and Name Test provide extra row results. They are using “or” to do the search logic.

    In other words, they return/filter rows that contain only “Name” and they also return rows that contain only “Test”. Along with rows that contain both Name and Test.

    Using a + sign, makes it such that only rows that contain both Name and Test are returned.

    I hope my point regarding why “Name”“Test” and Name Test makes sense, and why it does not produce the desired results of which rows get filtered out of the grid.

    I initially thought your suggestion with the space around the + sign worked, but it actually changes the results to use “or” instead of “and”, so it suffers from the extra results like the other suggestions.

    Hope that all makes sense, I’ll continue to use a + sign without spaces to get what I need, but it would be nice to get the highlighting fixed up.

    Please refer to my sample I posted at the start regarding the scenario that we would like fixed.

    Hope that makes sense.

  • Posted 17 January 2025, 11:14 am EST

    Hello,

    Thank you for providing more clarification on this behavior.

    We have shared your observations with the team and will update you once we have got more information.

    To workaround the behavior, you can use

    +"Name" +"Test"
    expression for filtering. Please refer to the attached modified sample. (see FlexGridSearchHighlightTest_Mod2.zip)

    Regards,

    Uttkarsh.

  • Posted 27 January 2025, 7:44 pm EST

    Hi Uttkarsh

    That’s great. Your syntax works perfect.

    Is there syntax documentation that I can refer to?

    Kind Regards

    James

  • Posted 28 January 2025, 3:33 am EST

    Hello James,

    Apologies, but this information is not available in documentation currently. We have forwarded your request to the concerned team for further insights and will update you once we have more information.

    Regards,

    Uttkarsh.

  • Posted 10 February 2025, 1:03 pm EST

    Hello James,

    As per the team, your initial issue of not all words highlighting in the cell after filtering has been fixed internally. [Bug Tracking ID: C1WIN-33574]

    Rest assured, we’ll update you once the fix is available.

    Regards,

    Uttkarsh.

  • Posted 12 February 2025, 8:05 pm EST

    Hi Uttkarsh

    Thanks for that… Also not sure what’s happening, but if you pass through something like “c:” it crashes out with length cannot be less than zero. eg.

    searchString = "\"c:\"";

  • Posted 13 February 2025, 3:27 am EST

    Hello James,

    We were able to observe the behavior on our side as well. We have escalated it to the development team for further investigation. [Internal tracking ID: C1WIN-33669]

    Rest assured, we’ll get back to you once we have more information.

    Regards,

    Uttkarsh.

  • Posted 17 February 2025, 5:28 am EST

    Hello James,

    As per the team, the behavior is a bug. We’ll update you once the issue’s fixed.

    [Bug Tracking ID: C1WIN-33672]

    Regards,

    Uttkarsh.

  • Posted 17 February 2025, 8:18 pm EST

    Thanks

Need extra support?

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

Learn More

Forum Channels