Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Window > Radwindow appearing behind child window

Not answered Radwindow appearing behind child window

Feed from this thread
  • lakshmi jeeva avatar

    Posted on Nov 24, 2011 (permalink)

    HI,

        In silverlight main page i am having button.If i click button it will open a radwindow. It is opening properly.In that radwindow i am having an image. If user single clicks or double clicks a image it has open a another radwindow.

       In imageMouseLeftButton_Down event i have written code like this

      

    Private

     

     

    Sub moPART_AnswerImage_MouseLeftButtonDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles moPART_AnswerImage.MouseLeftButtonDown

     

         Dim oImageViewer As New Radwindow2
         oImageViewer.ShowDialog()

     


    End
    Sub

    Find below is the xaml for Radwindow2

     

    <tkNavigation:RadWindow  

       x:Class="RAMWare.Controls.dlg_PhotoViewer"

      xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation

      xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml

      xmlns:msControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"

      xmlns:tkNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"

      xmlns:tkControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"

      Height="Auto"

      Width="Auto"

      WindowStartupLocation="CenterScreen"

      HorizontalAlignment="Center"

      VerticalAlignment="Center">

      

    <Grid x:Name="LayoutRoot" Margin="1">
    <Grid.RowDefinitions>

       <RowDefinition Height="Auto" /> 
      <RowDefinition Height="Auto" />

     </Grid.RowDefinitions>

     <StackPanel Orientation="Vertical">
             <Image x:Name="imgPhoto" Height="Auto" Width="Auto" Stretch="Uniform" />
    <StackPanel Orientation="Vertical" VerticalAlignment="Bottom">
     <StackPanel Width="Auto" Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="1">

     <Button  

    x:Name="cmdRotateCounterClockwise"
    Content="RotateCounterClockwise"
    Width="Auto"
    Height="23"
    HorizontalAlignment="Left" />

     <Button
        x:Name="cmdOK" 

        Content="OK"

            Width="75"

            Height="23"

            HorizontalAlignment="Center" />

     <Button

     x:Name="cmdRotateClockwise"

     Content="RotateClockwise"

     Width="Auto"

     Height="23"

     HorizontalAlignment="Right" />

     </StackPanel>
    <TextBlock

     x:Name="tblError"></TextBlock>

     </StackPanel>

     </StackPanel>

     </Grid> </tkNavigation:RadWindow>

     
    If user single click a image present in Radwindow1 it has to open Radwindow2.If user double cliks of a image present in Radwindow1 also opens a Radwindow2.But user double clicks a image, radwindow2 is opening behind Radwindow1 that is parent window.
    How to solve the problem?

    Reply

  • Manuel avatar

    Posted on Dec 21, 2011 (permalink)

    Hi,

    I´ve the same problem. When I try open a second window this window is showed behind the first one. Maybe the problem is the MouseLeftButton_Down even.

    Any help?

    Reply

  • Rosi Rosi admin's avatar

    Posted on Dec 21, 2011 (permalink)

    Hello all,

    I suggest you try opening the window by using  a Dispatcher when the code in the event handler of MouseLeftButton_Down event.

    Dispatcher.BeginInvoke( () => window.Show());

















    Kind regards,
    Rosi
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Manuel avatar

    Posted on Dec 21, 2011 (permalink)

    Hi Rosi,

    Thanks, your tip solve the problem.
    Thanks

    Reply

  • lakshmi jeeva avatar

    Posted on Feb 1, 2012 (permalink)

    Hi,

     

        I have used nested dispatcher to show the dialog.But still sometimes radwindow is going behind the parent window? I have followed below website.

         http://www.telerik.com/community/forums/silverlight/window/sl4-upgrade-problems-again-with-windows-newly-opened-window-appearing-behind-previously-opened-window.aspx

       Even i have tried to open a window using timer also. But still problem exists. It is very urgent work.I am using sl4.How to proceed further?

    Reply

  • Boyan Boyan admin's avatar

    Posted on Feb 6, 2012 (permalink)

    Hi lakshmi jeeva,

    There is an easy way to ensure that the RadWindow is always on top. You have to set the IsTopmost property to true. However setting this to a predefined dialog is a little bit more tricky. If you use a predefined dialog like Confirm or Alert. You have to apply a WindowStyle in order to set IsTopmost. Your code should look something like this:
    var dialogParams = new DialogParameters();
    Style radAlertStyle = this.Resources["RadAlertStyle1"] as Style;
    dialogParams.WindowStyle = radAlertStyle;
    RadWindow.Alert(dialogParams);
    And the style which is placed in the XAML is the following:
    <UserControl.Resources>
        <Style x:Key="RadAlertStyle1" TargetType="telerik:RadWindow">
            <Setter Property="IsTopmost" Value="true"/>
        </Style>
    </UserControl.Resources>

    Hope this helps. Let us know if you are still having problems.


    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 >>

    Reply

  • lakshmi jeeva avatar

    Posted on Feb 7, 2012 (permalink)

    Hi,
       I have used IsTopMost property. But i am getting error Property 'IsTopMost' is not exist in Telerik.windows.controls.navigation. I am using telerik version 2010.1.422.1030. I have used dispatcher to show the dialog like below

    Dispatcher.BeginInvoke( () => window.Show());

    But it was not working.SO i have tried nested Dispatcher.It is not working sometimes.If i single click a image the new dialog is opening.If i double a image two window is opening .One window is showing infront of parent window.Another window is going behind a parent window.

     

    I have opened the dialog in Image1_MouseLeftButtonDown event. In mouse left button down event i have opened the dialog like below

      

     

    moImageViewer =

     

    New dlg_PhotoViewer

     

     

     

    moImageViewer.ShowDialog()

    How to show the dialog when user double cliks as well as single a image without going behind the parent window?

     

    Reply

  • Boyan Boyan admin's avatar

    Posted on Feb 10, 2012 (permalink)

    Hi,

    You are using a rather old version and IsTopMost property is not existing in this version. It will be best to upgrade to a more recent version. The problem comes form the fact that if the RadWindow shows slower (if it has complex content in it), the background is not disabled until the RadWindow is shown, so in the time before it shows you can make another Click and open another Window. You can attach to the click event and disable another clicks, before the RadWindow is closed.

    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 >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Window > Radwindow appearing behind child window
Related resources for "Radwindow appearing behind child window"

Silverlight Window Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]