Flex grid with selection mode MultiRange, how to clear all selection ranges?

Posted by: bozjator on 19 October 2019, 6:40 am EST

  • Posted 19 October 2019, 6:40 am EST

    Hi,

    As the title says I'm using flex grid with selection mode set to MultiRange.
    How do i clear multiple selection ranges?
    If i use flexgrid.select(-1, -1); it only clears current / last selection.

  • Marked as Answer

    Replied 20 October 2019, 4:58 pm EST

    Hi,

    To remove all the selections, you will need to update all the selected ranges using the selectedRanges property and then call the select method. Please refer to the code snippet and the sample below:
    grid.selectedRanges.forEach(sr => {
    sr.setRange(-1, -1, -1, -1);
    });
    grid.select(-1, -1);
    grid.refresh();

    https://stackblitz.com/edit/js-vrtn12

    Regards,
    Ashwin
Need extra support?

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

Learn More

Forum Channels