C1FlexGrid selecteditems act different when marked with Shift or Ctrl-Key

Posted by: lutz.boscher on 5 November 2020, 7:51 pm EST

    • Post Options:
    • Link

    Posted 5 November 2020, 7:51 pm EST

    Hi,

    we are using C1FlexGrid in version 4.0.20202.716 and I have a question about the selecteditems. When I run the attached testapplication a Flexgrid with 20 items is shown. When I move the mouse while pressing the mouse button the underling items are marked as selected. After clicking on the button below the grid, I remove the items from the SelectedItemsCollection, the corrosponding items are removed from the grid, but the selection moves to the next items. Why? When I click on one row in the grid, held down the shift-key and click on another row, this range of rows are marked as selected and after clicking on the button, the grid behaves like described before. When I click on one row, held down the ctrl-key and click on other rows, these rows are marked. But when I click on the button, the rows are removed, but only one row is selected. Why acts the flexgrid different?

    C1SeletecItems.zip

  • Posted 8 November 2020, 8:42 pm EST

    Hi Lutz,

    Thank you for sharing the sample.

    The Shift key is used for selecting a single range whereas the Ctrl key is used for selecting multiple ranges.

    And as I can see you’re removing the items from FlexGrid’s SelectedItems along with your ObservableCollection which is causing the FlexGrid to re-render with the previously selected range in case of Shift key. However, in case of the Ctrl key FlexGrid doesn’t keep a backup of multiple selected ranges and hence it is re-rendered with the initially selected row.

    Therefore, clearing the selection first and then removing items from ObservableCollection solved the issue.

    Please verify the same from the attached modified sample. (see C1SelectedItems_Mod.zip)

    Regards,

    Kartik

    C1SelectedItems_Mod.zip

Need extra support?

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

Learn More

Forum Channels