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

MousePosition of RadContextMenu

2 Answers 105 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wenhao
Top achievements
Rank 1
Wenhao asked on 13 Mar 2012, 12:18 PM
Hi,

Currently we upgraded the Telerik RadControls from 2011Q3(for SL4) to 2012Q1(for SL5), but we noticed that the MousePosition property of RadContextMenu would now return a value relative to the child UIElement. How could we still get the mouse position on visual parent of RadContextMenu when it's opened, just like it was in version 2011 Q3? We just test using the following codes, but the result varies.

<Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadContextMenu.ContextMenu>
            <telerik:RadContextMenu x:Name="ContextMenu" Height="200" Width="150"
                                    Opened="ContextMenu_Opened">
            </telerik:RadContextMenu>
        </telerik:RadContextMenu.ContextMenu>
        <Grid Width="300" Height="300" Background="Red">
        </Grid>
    </Grid>

2 Answers, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 19 Mar 2012, 03:51 PM
Hello Wenhao,

We managed to reproduce the change in behavior. We have made some changes to the behavior of the control. You can check the changes here. It seems that one of this changes has caused this different behavior. We will further investigate this and will follow up this thread.

Regards,
Boyan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Boyan
Telerik team
answered on 21 Mar 2012, 10:31 AM
Hi,

This change is intended, as this is needed in some other scenarios. There is a workaround for your case though. You can use TransformToVisual method. I have attached a simple project how this can be achieved. Hope this works for your.

Greetings,
Boyan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Menu
Asked by
Wenhao
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or