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

Simple question about mouse events

2 Answers 43 Views
Docking
This is a migrated thread and some comments may be shown as answers.
C Bates
Top achievements
Rank 1
C Bates asked on 06 Jan 2010, 11:43 PM
Hello,
A simple RadPane containing nested Canvas controls:
      <telerikDocking:RadDocking Grid.Row="1" HorizontalAlignment="Stretch" d:LayoutOverrides="Height"
          <telerikDocking:RadDocking.DocumentHost> 
              <telerikDocking:RadSplitContainer x:Name="split1"
                  <telerikDocking:RadPaneGroup x:Name="group1"
                      <telerikDocking:RadPane x:Name="pane1" Header="pane1"   
                                              HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                              MouseLeftButtonDown="pane1_MouseLeftButtonDown"
                              <Canvas x:Name="canvas1" MouseLeftButtonDown="c1_MouseLeftButtonDown"
                                <Canvas x:Name="Canvas2" MouseLeftButtonDown="Canvas2_MouseLeftButtonDown"
                                    <Rectangle Height="40" Width="60" Fill="AliceBlue"/> 
                                </Canvas> 
                            </Canvas> 
                          </telerikDocking:RadPane> 
                  </telerikDocking:RadPaneGroup> 
              </telerikDocking:RadSplitContainer> 
          </telerikDocking:RadDocking.DocumentHost> 
      </telerikDocking:RadDocking> 
 
How do I get mouse events at the Canvas level?  None of the MouseLeftButtonDown handlers are called when I click on the canvas, but the two handlers attached to the Canvas controls are called when I click on the Rectangle.
Thanks for the help.


2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 07 Jan 2010, 07:30 AM
Hello C Bates,

All panels (like Canvas, Grid, StackPanel) should have Background set in order to receive Mouse related events. This is required by the framework. Transparent background will also work.

Let us know if you need more information.

Kind regards,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
C Bates
Top achievements
Rank 1
answered on 08 Jan 2010, 07:28 PM
Thanks for the quick reply.
Tags
Docking
Asked by
C Bates
Top achievements
Rank 1
Answers by
Hristo
Telerik team
C Bates
Top achievements
Rank 1
Share this question
or