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

Problem with Silverlight Radwindow on a radwindow

3 Answers 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
bibin Kuriyan
Top achievements
Rank 1
bibin Kuriyan asked on 28 Nov 2011, 11:01 AM

 

 

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

3 Answers, 1 is accepted

Sort by
0
Anuraj
Top achievements
Rank 1
answered on 23 May 2012, 12:12 PM
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....
0
Anton
Top achievements
Rank 1
answered on 01 Jun 2012, 05:58 PM
Unfortunately this solution does not work, Unload Load calls as well. Actually I cant find method "OnGotFocued", did you mean "OnGotFocus"?
0
Anuraj
Top achievements
Rank 1
answered on 19 Jul 2012, 10:49 AM

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

Tags
General Discussions
Asked by
bibin Kuriyan
Top achievements
Rank 1
Answers by
Anuraj
Top achievements
Rank 1
Anton
Top achievements
Rank 1
Share this question
or