This is a migrated thread and some comments may be shown as answers.

How to hold CTRL and select multiple RadGridView rows?

3 Answers 116 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 13 May 2014, 10:23 PM
I cannot seem to figure out how to hold CTRL and select multiple RadGridView cells to select multiple rows at once.

When I attempt to record the actions, each time I hold CTRL and click a row, the recorder opens the record rather than just selects it.

When I attempt to use the following snippets of code to select a cell in row 1 and 2, the first selection is not retained:

RadGridView grid = Pages.Test.SilverlightApp.TestRadGridView;

grid.Rows[0].Cells[0].User.Click(MouseClickType.LeftClick, 1, 1, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(131072)));
grid.Rows[1].Cells[0].User.Click(MouseClickType.LeftClick, 1, 1, ArtOfTest.Common.OffsetReference.TopLeftCorner, ArtOfTest.Common.ActionPointUnitType.Percentage, ((System.Windows.Forms.Keys)(131072)));

How can I hold CTRL and select more than 1 RadGridView item, and retain each item(s) selected previously?

Thanks,
Nick

3 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 14 May 2014, 02:35 PM
Hello Nick,

Please try to using the following lines and put between them the click steps, this way you are simulating pressing the control key, doing some clicks and then releasing the control key. It should do the trick.

Manager.Desktop.KeyBoard.KeyDown(Keys.Control);
 
//You can put the click steps HERE
 
Manager.Desktop.KeyBoard.KeyUp(Keys.Control);

Please note that you should add the System.Windows.Forms.dll as shown in this article in order to use the code above.

Hope this helps.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Sarah
Top achievements
Rank 1
answered on 01 Dec 2014, 07:03 PM
I have attached my steps that I am currently working on. I am having the same issue as Nick.
In your screen shot in reply to Nick it looks really simple. I have tried adding this to the code viewer when trying to customize the step. But it is not working for me and I am obviously doing something wrong. Can you look at my screen shot and give me any guidance? It would be immensely appreciated.
0
Ivaylo
Telerik team
answered on 04 Dec 2014, 11:36 AM
Hello Sarah,

Please note that if you are experiencing the same issue as Nick the code should work without any problems. From the screnshot provided I am not quite sure we are on the same page.

Please provide more details. Also please note that this is a public forum post and all the information provided is public available. In case you need to share some private information please make sure you submit a support ticket instead.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Nick
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Sarah
Top achievements
Rank 1
Share this question
or