Completed
Last Updated: 01 Jun 2017 10:51 by ADMIN
ADMIN
Stefan
Created on: 09 Jan 2017 11:27
Category: GridView
Type: Bug Report
1
GridView: With SelectionMode set to Extended, the items programmatically added to the SelectedItems collection are not synchronized with the selection performed through the UI or keyboard
When an Extended selection is performed by the user, the items programmatically added to the  SelectedItems collection need to be taken in consideration. Currently, they are not  A scenario with a source collection of 10 items  and the item at index 4 being added to the SelectedItems of the control can serve as an example. If the user presses Shift+Down, the expected result would be the items at index 4 and 5 to be selected. Instead, all items until the item at index 5 are selected. The same behavior can be reproduced with Shift+Click as well.


Available in LIB version: 2017.2.605
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
2 comments
ADMIN
Stefan
Posted on: 16 Jan 2017 14:20
Hello Simon,

Thank you very much for providing a sample application and a step by step instruction demonstrating the reported issue. If further discussion is needed, please, let us continue the communication in the support thread you opened.

All the best,
Stefan
Simon
Posted on: 12 Jan 2017 19:26
I originally reported this bug (in a support ticket).  I attach GridRowSelection, a Visual Studio 2015 C# WPF solution that demonstrates it.
NOTE:  You will probably have to update the paths of the references to Telerik UI for WPF DLLs in the project file.

Program GridRowSelection shows:

    A read-only RadGridView grid that supports selection extension, populated with 5 rows.
    A "Select a Row" button, which, when clicked,  makes a specific row the only selected row and makes a specific cell within that row the current cell.  To keep things simple, the required row and column are hard-coded.

To sum up the bug in a single sentence:
After row selection has been programmatically set by clicking the button, row selection extension is erroneous. 

The key point is that the bug only happens after SelectedItems has been set programatically.  In normal usage, SelectedItems keeps track of GUI-initiated selection extension just fine. 

The following examples, using the demo program, show that the specific erroneous result depends on what, if anything, is selected in the grid prior to programmatically setting row selection.

1-based row numbers are shown in the examples.

Example 1

Steps to reproduce:

    Without first entering the grid, click the Select a Row Button.
            Row 3 is selected, with its second cell current.
    To extend the selection down to row 4, key Shift+Down or mouse Shift+Click in the grid.

Actual Result:

    All rows from 1 to 4 are selected.

Expected Result:

    Only rows 3 and 4 should be selected.

Example 2

Steps to reproduce:

    Click row 5 to make it the only selected row.
    Click the Select a Row Button.
            Row 3 is selected, with its second cell current.
    To extend the selection down to row 4, key Shift+Down or mouse Shift+Click in the grid.

Actual Result:

    Rows 4 and 5 are selected.

Expected Result:
 Rows 3 and 4 are selected.
Attached Files: