Keyboard focus problem in RadPane

5 posts, 0 answers
  1. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 04 May 2009 Link to this post

    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>

     

     

     

     

     

     

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 06 May 2009 Link to this post

    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.
  3. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 06 May 2009 Link to this post

    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


  4. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 06 May 2009 Link to this post

    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.
  5. Piet
    Piet avatar
    19 posts
    Member since:
    Apr 2009

    Posted 08 May 2009 Link to this post

    I will try the sollution after getting drag and drop of grid rows working. (in draganddrop forum)
    --piet
Back to Top