Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Menu > Menu Focus on Click

Not answered Menu Focus on Click

Feed from this thread
  • MiddleTommy Intermediate avatar

    Posted on May 13, 2011 (permalink)

    Something has changed in a recent nightly update with what I have decided is the RadMenu / RadMenuItem.
    I believe when a user clicked on a menuitem in previous versions that the menu or item got focus.
    This would commit any edits you were doing in textboxes or gridviews.
    Now when you click a menuItem the grid or textbox keeps focus and does not update the source on any databindings.
    I can see how you would not want to loose focus on say a "Copy" menu item.
    But you do want to loose focus on a "Save" menu item.

    I am currently having to go through my app an make sure all Databindings are updated when a menuitem such as "Save" is clicked.
    My users started reporting behavior of "I swear I entered that info before I saved it"

    What can be done to solve both scenarios of menuitem click and focus behavior?
    I am using the latest dev version 2011.1.419.1040

    Reply

  • Hristo Hristo admin's avatar

    Posted on May 16, 2011 (permalink)

    Hello Tommy,

    We did some changes/improvements in RadMenuItem related to ICommand and IsEnabled but we still Focus MenuItems because otherwise there will be no keyboard navigation.

    Could you send us sample project where we can reproduce this behavior?

    Regards,
    Hristo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • MiddleTommy Intermediate avatar

    Posted on Aug 30, 2011 (permalink)

    I think the RadGridView Changed I now have to explicitly set 
    ActionOnLostFocus="CommitEdit"
    in the RadGridView xaml definition.

    Reply

  • Jens Hobbie avatar

    Posted on Oct 21, 2011 (permalink)

    Hello,
    This problem occurs in our application also.
    We have a RadGridView and a RadToolbar. Grid has ActionOnLostFocus="CommitEdit" set.
    But when grid row is in edit and if we are editing a custom column, CommitEdit is not performed on lost focus. (Custom column has an RadDropDownButton (with custom form as content) as a cellEditElement.) Grid just closes the dropdown button but for some does not pefrom CommitEdit after that...
    This is a problem because contented entered in form (contained in dropdown button) is not committed to changes to object (if for example user clicked save button in toolbar it will not be saved).
    So you maybe have an idea what is wrong? Any advice/tip would be helpful.

    Reply

  • MiddleTommy Intermediate avatar

    Posted on Oct 21, 2011 (permalink)

    I think it is a problem in Silverlight in general. The Lost Focus event is triggered after the button click event. I believe the latest version of Telerik Silverlight RadControls fixed this issue.

    But if not, I have found that setting focus to the menu when mouseenter will solve this problem.
    The grid looses focus properly and commits the edit.

           
    private void RadMenu_MouseEnter(object sender, MouseEventArgs e)
    {
        var m = sender as RadMenu;
        if (m != null)
            m.Focus();
    }


    Reply

  • Jens Hobbie avatar

    Posted on Oct 27, 2011 (permalink)

    Hello MiddleTommy,

    Thank you on your suggestion, but unfortunately this did not help in our specific problem.
    RadDropDown button was still not closed and CommitEdit action was not performed.

    Finally we solved it by adding a bit of a hack code to GetNewValueFromEditor methods in our custom column class:
    //close dropdown button
    (editor as RadDropDownButton).IsOpen = false;
     
    //focus parent grid of control
    RadGridView parentGrid = (editor as RadDropDownButton).ParentOfType<RadGridView>();
    parentGrid.Focus();
    We force RadDropDown button to close and return focus to parent RadGridView.
    And now CommitEdit action will be performed when user clicks button in menu...

    I know it is not very elegant, but it worked. :)

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Menu > Menu Focus on Click
Related resources for "Menu Focus on Click"

Silverlight Menu Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]