Problem with Silverlight Radwindow on a radwindow

4 posts, 0 answers
  1. bibin Kuriyan
    bibin Kuriyan avatar
    1 posts
    Member since:
    Jun 2011

    Posted 28 Nov 2011 Link to this post

     

     

    Hello,

      I have an application on Silverlight using radwindow on a radwindow. While closing the child radwindow, the unload event of its parent will fire.

    Here I am adding my sample applications codes,

    This is to open a radwindow from the main container, its name is “RADWINDOW1

    Dim radwindow1 As New Telerik.Windows.Controls.RadWindow

            Dim aa As New PopUpWindow()

            radwindow1 .Content = aa

            radwindow1 .Width = 500

            radwindow1 .Height = 500

            radwindow1 .WindowStartupLocation = WindowStartupLocation.CenterScreen

            radwindow1 .ShowDialog()

    Inside the first popup ,opeing the another radwindow, its name is “RADWINDOW2”.Here I added the code

    Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)

            Dim radwindow2 As New Telerik.Windows.Controls.RadWindow

            Dim aa As New PopUp2()

            radwindow2.Content = aa

            radwindow2.Width = 500

            radwindow2.Height = 500

            radwindow2.WindowStartupLocation = WindowStartupLocation.CenterScreen

            AddHandler ss.Closed, AddressOf OnClosed

            radwindow2.ShowDialog()

        End Sub

     While closing the radwindow i.e RADWINDOW2 I am trying to open another radwindow, its name is RADWINDOW3 on the close event of RADWINDOW2.Here I added the code.

    Sub OnClosed()

            Dim radwindow3 As New Telerik.Windows.Controls.RadWindow

            Dim aa As New PopUp2()

            radwindow3.Content = aa

            radwindow3.Width = 500

            radwindow3.Height = 500

            radwindow3.WindowStartupLocation = WindowStartupLocation.CenterScreen

            radwindow3.ShowDialog()

        End Sub

    While doing like this RADWINDOW1’s  unload event fires.
    Any suggestion on this problem.How to avoid this  ???...........

  2. Anuraj
    Anuraj avatar
    3 posts
    Member since:
    Jan 2011

    Posted 23 May 2012 Link to this post

    The best way is to override the OnGotFocued member function of RadWindow and dont call the base function from it. So it will avoid the Calling the GetFocus event and will not call Unload Load fo RadWindow....
  3. Anton
    Anton avatar
    3 posts
    Member since:
    Aug 2011

    Posted 01 Jun 2012 Link to this post

    Unfortunately this solution does not work, Unload Load calls as well. Actually I cant find method "OnGotFocued", did you mean "OnGotFocus"?
  4. Anuraj
    Anuraj avatar
    3 posts
    Member since:
    Jan 2011

    Posted 19 Jul 2012 Link to this post

    Yes.
    Try bellow code and use the ExtendedRadWindow class in your code. It will at least avoid the Unload Load call.

    C#
    ExtenedRadWindow : RadWindow
    {
     protected override void OnGotFocus(RoutedEventArgs e)
            {
                if (e.OriginalSource is Button)// as u are opening new popup on button click
                    return;

                base.OnGotFocus(e);
            }
    }

    VB:
    Public Class ExtenedRadWindow Inherits RadWindow

     

    Protected Overloads Overrides Sub OnGotFocus(e As RoutedEventArgs)
     If TypeOf e.OriginalSource Is Button Then
      ' as u are opening new popup on button click
      Return
     End If

     MyBase.OnGotFocus(e)
    End Sub
    End Class




    Add Constructor if needed :)

Back to Top