MultiRange Selection Programmatically in a PivotGrid

Posted by: georgekam96 on 29 January 2020, 10:48 pm EST

  • Posted 29 January 2020, 10:48 pm EST


    We have a case in which we want to programmatically select multiple cell ranges on a PivotGrid. It seems that the `select` function only works with a single cell range. Any next selection overwrites the previous one.

    Is there a way to achieve the desired functionality via Wijmo's API?
  • Replied 30 January 2020, 5:33 pm EST

    In the PivotGrid, Multiple CellRange can be selected by changing the SelectionMode same as FlexGrid.
    If you would like to the non continuous selection, please set the selectionMode to MultiRange. The different selected CellRanges can be get using the selectedRanges property.

    Please refer to the following documentation for different selection modes:

    Hope it helps!

    Manish Gupta
  • Replied 2 February 2020, 8:50 pm EST

    Greetings again,

    We want to select multiple cell ranges programmatically. Setting the `selectionMode` to `MultiRange` allows the user to select multiple non-continuous cell ranges, but even on this mode we cannot select multiple ranges by calling the `select` method.

    Please, take a look at the example in the following link:

    As you can see the `selectionMode` is set to `MultiRange` and the user can, in fact, select multiple non-continuous ranges. However, we still cannot select multiple ranges programmatically, because any new selection that is performed, essentially, overwrites the previous one.
  • Replied 3 February 2020, 4:23 pm EST

    Hi George,

    We have asked the dev team on this issue. The tracking id of the case is 419478. We will update you as soon as we will hear from them.

  • Replied 11 February 2020, 9:56 pm EST

    Hi George,

    The devs have updated the FlexGrid by which we can set the selectedRanges property to an array of CellRange to achieve multiple selections using JS. This update will be added in the next release of Wijmo.
    In the meantime, you can use private property _selHdl to select multiple ranges. Please refer to the sample below:

  • Replied 20 February 2020, 10:37 pm EST

    Hi guys

    I am using Multi Range too, and the user can use checkboxes or ctrl + click to select rows.

    Is there a trigger for ctrl+click? Like this I don't need to handle checkboxes and clicks, I could just trigger the existing method when the user uses the checkbox.

    Found what I think is an issue:
    - Select the 1st, 3th and 5th rows of a grid, mantain the selection and with the ctrl pressed, click on 1st, 3th and 5th again(in this order), now the selectedRanges will have 6 items, the getClipString will return 6 items and not 3
Need extra support?

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

Learn More

Forum Channels