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

Custom user control focus in RadMenuItem

3 Answers 58 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 15 May 2012, 12:43 AM
Hello,

I have a user control that contains a text box and a search button. This user control has been added to a RadMenu as follows:

 <telerik:RadMenu HorizontalAlignment="Stretch" DataContext="{Binding SimpleSearchViewModel}">
            <telerik:RadMenu.ItemsPanel>
                <ItemsPanelTemplate>
                    <DockPanel HorizontalAlignment="Stretch" />
                </ItemsPanelTemplate>
            </telerik:RadMenu.ItemsPanel>
            <telerik:RadMenu.Items>
                <telerik:RadMenuItem Header="Menu1" /> 
                <telerik:RadMenuItem Header="Menu2" />  
                <telerik:RadMenuItem HorizontalAlignment="Right">
                    <telerik:RadMenuItem.Header>
                        <searchctrls:SimpleSearchView />
                    </telerik:RadMenuItem.Header>
                </telerik:RadMenuItem>

            </telerik:RadMenu.Items>
</telerik:RadMenu>

This seems to work fine. The problem I am experiencing is that when the user control (SimpleSearchView) is focused, say, with the cursor in the textbox, it takes two (2) clicks to close the application using the "X" at the corner of the window. This behavior does not seem to appear with any other UI item in my application, i.e. I can focus the textbox in the SimpleSearchView control and then click another menu item without a problem.

Could you help me resolve this issue?

Let me know if a separate sample project would be helpful.

Many thanks

3 Answers, 1 is accepted

Sort by
0
Simon
Top achievements
Rank 1
answered on 16 May 2012, 04:38 PM
Hi,

This question has been posted for more than than a day now. Is Telerik support reviewing all the questions / posts? Do I need to provide more information or is my question unclear? Am I missing something?

Thanks
0
Accepted
Georgi
Telerik team
answered on 18 May 2012, 08:43 AM
Hi Simon,

We are sorry for the late reply.
I was able to reproduce the issue. In order to prevent those kind of issues RadMenu is listening for a Click related events. As you can see in the attached project the LeftMouseButtonDown event is not triggered and the RadMenu does not register any Click related event so it just loses focus. What you can do is use RadWindow instead of Window. In the attached project you can see that it works just fine with RadWindow.

Greetings,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Simon
Top achievements
Rank 1
answered on 18 May 2012, 04:09 PM
Thank you for the answer, it is greatly appreciated!
Tags
Menu
Asked by
Simon
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or