How to hold CTRL and select multiple RadGridView rows?

4 posts, 0 answers
  1. Nick
    Nick avatar
    23 posts
    Member since:
    Nov 2013

    Posted 13 May 2014 Link to this post

    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
  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 14 May 2014 Link to this post

    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!
  3. Sarah
    Sarah avatar
    2 posts
    Member since:
    Apr 2014

    Posted 01 Dec 2014 in reply to Ivaylo Link to this post

    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.
  4. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 04 Dec 2014 Link to this post

    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!
Back to Top