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

Keyboard focus problem in RadPane

4 Answers 67 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Piet
Top achievements
Rank 1
Piet asked on 04 May 2009, 03:30 PM

I have a component (DiagramLite) that receives keydown events when inside a gridrow

When its inside a RadPane (See below) i donot get the keydown events.

The helpdesk of DiagramLite suggested looking for properties that could keep focus from the component (wich i could not find).

Any suggestion on where to search for a sollution ?

Below a part of the xaml:

Context is silverlight 2.0  telerik Q1 2009 diagramlite 1.02

thanks in advance,

Piet Goot Kormelink

 

<

 

Grid x:Name="GridHome">

 

 

 

<Grid.RowDefinitions><RowDefinition Height="auto"/>  <RowDefinition Height="*"/> </Grid.RowDefinitions>

 

 

 

<d:Diagram x:Name="diagramTest" Grid.Row="0" Width="1000" Height="1000" ShowGrid="True" Background="Azure" Loaded="diagram_Loaded"/> <!-- this one focus ok -->

 

 

 

<

 

radDock:RadDocking Grid.Row="1">

 

 

 

  <radDock:RadSplitContainer x:Name="PaneContainerFlow" Orientation="Horizontal" InitialPosition="DockedTop">

 

 

 

    <radDock:RadPaneGroup>

 

 

 

      <radDock:RadPane x:Name="PaneFlow1" Header="Inkoop procedure" IsPinned="False"  radDock:RadDocking.SerializationTag="PaneFlow1">

 

 

 

        <ScrollViewer Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">

 

 

 

          <d:Diagram x:Name="diagramPurchase" Width="3000" Height="3000" ShowGrid="True" Background="Azure" Loaded="diagram_Loaded"/>

 

 

 

        </ScrollViewer>

 

 

 

      </radDock:RadPane>

 

 

 

   </radDock:RadPaneGroup>

 

 

 

</radDock:RadSplitContainer>

 

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 06 May 2009, 07:19 AM
Hi Piet,

What kind of keyboard events are you using in this component? I'd like to investigate the problem, but I don't know which events you need.

Kind regards,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Piet
Top achievements
Rank 1
answered on 06 May 2009, 11:30 AM
Hello,

I'am adding a keyDown event handler on bothe the complete diagram and on a box added to the diagram.

using MindFusion.Diagramming.silverlight.Layout;

diagram.KeyDown += new KeyEventHandler(diagram_KeyDown);

box.KeyDown += new KeyEventHandler(box_KeyDown);

Regards, Piet


0
Miroslav Nedyalkov
Telerik team
answered on 06 May 2009, 02:52 PM
Hi Piet,

I investigated the problem and what I found out was that the Diagram component did not get the KeyBoard focus even if it was clicked. The only way to focus it is to press the Tab key several times.
 
The Docking control uses tab controls in it and you have to press the Tab key a lot of times before getting to the Diagram and that is why you cannot handle the KeyDown event - it is really hard to move the focus to the Diagram.

This means that the problem is not in the Docking control, but in the Diagram control. Anyway, I found a workaround. You can handle the MouseDown event of the Digaram component and to force the focus to go to the component. Below is the code:
private void Diagram_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) 
    (sender as Diagram).Focus(); 
 

Hope this helps.

Regards,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Piet
Top achievements
Rank 1
answered on 08 May 2009, 02:19 PM
I will try the sollution after getting drag and drop of grid rows working. (in draganddrop forum)
--piet
Tags
Docking
Asked by
Piet
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Piet
Top achievements
Rank 1
Share this question
or