Gridview taking focus on context menu close

4 posts, 0 answers
  1. Paul
    Paul avatar
    42 posts
    Member since:
    Jan 2012

    Posted 25 Mar 2013 Link to this post

    Hello.
    I am using the context menu in the GridView and under some circumstances displaying a Popup to the user.  When I do this I see focus being placed on the user control within the Popup but it immediately leaves.  The focus is being placed back onto a cell.  My attempts to intercept this have failed.  Is there some mechanism or pattern available to resolve this?

    I am using the same pattern from within the ChildHierarchyTemplate the focus remains on the user control within the Popup.

    Thank you

    Paul
  2. Yoan
    Admin
    Yoan avatar
    1180 posts

    Posted 28 Mar 2013 Link to this post

    Hello Paul,

    In order to investigate and resolve the problem, would it be possible to share with us more details on your exact implementation? Moreover, could you test your solution with binaries from our latest official release - version 2013.1.0220? If you get the same result, please try isolating the problem in a sample runnable project. We will check what is going on and will assist you further.

    Thank you in advance.

    Kind regards,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Paul
    Paul avatar
    42 posts
    Member since:
    Jan 2012

    Posted 28 Mar 2013 Link to this post

    I have created ticket 676477 as per your reqeust.

    Thanks

    Paul
  4. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 01 Apr 2013 Link to this post

    Hi Paul,

    We've already answered to your support ticket, but I'm pasting my answer here as well, so if anyone else have the same problem, they could take a look at this solution.

    The problem is not caused by RadContextMenu or RadGridView. It is dedicated to the way you are trying to open the Popup. First of all you say that you want to close RadContextMenu and open the popup. In this case I suggest you to open the popup on RadMenuItem Click. When RadMenuItem is clicked, it will automatically close RadContextMenu. You can also close it manually by setting IsOpen property to false. In your case you are using buttons inside RadMenuItem and they are handling the Click event. So it doesn't reach RadMenuItem and this way RadContextMenu is not closed.
    For your other problem - in my opinion there are two ways:
    - put TextBox directly as a child of the popup.
    - put UserControl as a child of the popup.
    Both ways will have similar code. I'm sending you a project how to achieve the desired functionality (I've used UserControl as a child of the popup).

    Hopefully this helps.

    All the best,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top