I have a UltraGrid with checkbox. I need to select multiple rows. Its working when I'm select the row manually.
but when I'm setting focus to the row by code behind, the Shift key selection is not working.
Here I have attached sample,
after reloading the data, I need to set the focus to the row which is last selected. so I am navigating to the grid by
grid.Rows[_currentRowIndex].Activate();
grid.Rows[_currentRowIndex].Selected = true;
after this line, when I'm press shift key to select, its not selecting multiple rows. its selecting the single row.
Eg : when I'm in the 6th row, after reloading the data, the focus should be in the 6th row. So I'm navigating to the 6th row by above 2 lines. after that when I'm selecting other row with shift key, it should select multiple rows. But its not happening.InfraSample.zip
Hello,
Thank you for sharing the sample for testing the behavior, although i noticed that you are using version 14.1 which is no longer supported and fix bugs, as per product life cycle. I tested the behavior with supported version V22.1 and not able to reproduce the issue . I attached as video showing the behavior i am getting and steps i have taken, for me i am able to select the other rows using shift key.
So i would suggest you to upgrade to latest supported version to get the fix.
Recording #73.zip
Hi
I verified with latest version also am getting same issue. After reloading we have to use shift + mouse click to select multiple records in that case it's not selecting multiple records. In the shared video also, u focused on row6 after reload button click you selecting from row6 to row13 using shift + down arrow, it's not happening it taking from row7.
Here is my another video , i am using shift + mouse click to select multiple records after reload.
with my previous video i didnt select 'row6' hence it was not selected.
Share your video demonstrating the issue and the version you are using would help to narrow down the issue.
Recording #74.zip
Hi I focused on row3 and click reload button after that press shift + mouse click on row13 its not happening for multiple selection. Here I attached the video for your reference and I am using version V21.2SampleVideo.zip
Your video is not clear of what you are expecting. You click reload button and then clicked row13 but checkbox of row13 dint get selected. Is this your issue or you are expecting to get rows from row6 to row13 get select?
For me when i click any row after i click reload button its get selected as in the video, which is expected. Rows from row6 to row 13 will not select since you are clicking reload button datasopurce will change..
The grid doesn't retain it's selection upon a data source change. Perhaps there may be an alternative to resetting the Datasource for you. Or you'll have to store a list of all indices (you are doing this already for index 0eg. grid.Rows[_currentRowIndex].Selected = true;
Let me know if you have any questions.
Yes , my expectation is to select from row6 to row13.
Consider when i'm in row6, and click to reload data. like i mentioned in first post, after reloading the data i setting the focus to row6 by
with the above lines, focus setting to row6. now when i'm selcting shift + mouse click to row13.
im expectng to select, row6 to row13 . but its not happening.
don't consider tick field, here i'm talking about multiple row selection.
Hello P Siva,
I have been investigating into the behavior you are seeing in this case, and the reason you are seeing this issue is because the Shift+Click selection behavior comes from a “pivot item” element that we track, essentially by the last row you have clicked. When you reset the data source, this is reset as well, which is why when you try to Shift+Click Row 13 from Row 6, only Row 13 is selected.
Something you can do to prevent this is to utilize the UltraGrid.ActiveRowScrollRegion.SetPivotItem() method and pass the Row that you want to be the “pivot item” as a parameter when you reset the selection. For example, using your code example above:
var row = grid.Rows[_currentRowIndex];
row.Activate(); row.Selected = true;
RowScrollRegion region = this.grid.ActiveRowScrollRegion; region.SetPivotItem(row);
Please let me know if you have any other questions or concerns on this matter.
Any update on the above query?