RadWindow throws NullReferenceException

13 posts, 0 answers
  1. paul
    paul avatar
    16 posts
    Member since:
    Jul 2008

    Posted 07 Nov 2008 Link to this post

    Hi,

    I've just updated our application to use the q3 release, and we are getting an exception after showing the window.

    We are using RadMenu in the parent control, and we create instances of our custom control which inherits from RadWindow whcih includes RadComboBox's.

    I'm not sure how to go about debugging this issue.

    "Unhandled Error in Silverlight 2 Application
    Code: 4004    
    Category: ManagedRuntimeError       
    Message: System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.Windows.Controls.RadWindow.GetParentRadWindow(DependencyObject child)
       at Telerik.Windows.Controls.RadWindow.OnLostFocus(RoutedEventArgs e)
       at System.Windows.Controls.Control.OnLostFocus(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)  

    Regards,

    Paul Chapman 
    "
  2. Jeremy
    Jeremy avatar
    24 posts
    Member since:
    Oct 2008

    Posted 07 Nov 2008 Link to this post

    We are running into this same issue (Null Reference Exception at Telerik.Windows.Controls.RadWindow.GetParentRadWindow(DependencyObject child)

    We have an extended RadWindow xaml (for base behavior of our windows) and are instantiating the extended RadWindow, setting the content of the instantiated object, and then calling Show() (or ShowDialog()).  The content within the RadWindow is a UserControl with a Grid as the root control.

    This functionality worked when using the RC1 binaries, however we upgraded to the Q3 Trial release today and began having this issue.

    Thank you for your help.
    - Jeremy

  3. DevCraft banner
  4. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 08 Nov 2008 Link to this post

    Hello Paul, Jeremy,

    We will research this problem and will provide you with a solution in the coming days. We have another scheduled release this week, so will try to fix the problem until then.

    Thanks for your feedback!


    Greetings,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Bichitra
    Bichitra avatar
    34 posts
    Member since:
    Aug 2008

    Posted 10 Nov 2008 Link to this post

    Hi,

    I have the same problem with new version, It would be better to send a mail to all user,as you are releasing new version.
    Really It is also breaking to previous version with RadWindow control. closing event is removed.

    Thanks
    Bichitra
  6. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 11 Nov 2008 Link to this post

    Hello Bichitra,

    We are currently resolving the issues, thus you will have it fixed for the new release.

    Our policy dictates that breaking changes shouldn't be introduced after an official version is released. Until now we have had only beta versions which means that we don't guarantee that one beta will work with a later one. From now on, since we have had an official release of Silverlight 2 control, we will mark all classes and methods obsolete in case they won't be used or will be subject to change in the later versions. I am sorry again for the caused inconvinience.

    Regards,
    Hristo Borisov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 11 Nov 2008 Link to this post

    Hello Paul, Jeremy,

    It seems that both of you are experiencing the same issue. Unfortunately, we cannot reproduce your problem, that is why I would like you to send us a simple solution with the inherited RadWindow and your UserControl in which you are getting the exceptions so that I can research the problem better. Thank you for your patience.

    Kind regards,
    Hristo Borisov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 11 Nov 2008 Link to this post

    Hi Paul, Jeremy,

    Ignore my last post, I managed to resolve the unhandled error you were getting, so look forward to downloading our latest bits.

    All the best,
    Hristo Borisov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Kalle
    Kalle avatar
    3 posts
    Member since:
    Mar 2008

    Posted 17 Nov 2008 Link to this post

    Hi!

    We are facing this issue with tabcontrol (that has our custom control in it).

    Any estimate when the fix will be available? This is currently causing semi-blocker issue.


    Br,

    Kalle
  10. mlhkml
    mlhkml avatar
    6 posts
    Member since:
    Aug 2007

    Posted 24 Nov 2008 Link to this post

    I have the same NullReferenceException.
    I linked a simple demonstration to show my prgramming architecture to use RadWindow control.
    www.mktekin.com/demo/demo.rar
    Unfortunately, after page loading, when I try to click on window, I faced an unexpected error.

    Melih Kemal TEKİN
    InEduSo, California
  11. Hristo Borisov
    Admin
    Hristo Borisov avatar
    298 posts

    Posted 25 Nov 2008 Link to this post

    Hi Melih and Kalle,

    Melih,I downloaded your demo project and the version of the assembly you are using is from our official Q3 release. Since then we have introduced a new release on November 17 (SP1) that fixes some small issues mostly regarding the control templates of our controls. I advice you to download the latest version and check the release history on our website.

    Kalle, are you using the latest version? If yes, please send us a sample project or code snippet and the error message so we can research the problem further.

    Thank you for your feedback, and feel free to contact us if you have any further questions.

    Regards,
    Hristo Borisov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  12. Kalle
    Kalle avatar
    3 posts
    Member since:
    Mar 2008

    Posted 25 Nov 2008 Link to this post

    Hi!

    I believe our issue was resolved with the latest update.

    Will doublecheck and update here if it still persists.

    Br,

    Kalle
  13. Virendrasinh
    Virendrasinh avatar
    1 posts
    Member since:
    Dec 2014

    Posted 19 Dec 2014 Link to this post

    I have same problem of RadWindow throws NullReferenceException.
    I have attached sample code.

    Thanks
    Virendrasinh
  14. Polya
    Admin
    Polya avatar
    200 posts

    Posted 24 Dec 2014 Link to this post

    Hello Virendrasinh,

    The NullReferenceException is thrown when you are trying to set the Value of the txt_Name and txt_Address. They are in the UserControl1 that is placed inside the SampleWin RadWindow.
    You are calling the RadButton_Click_2 method with the instance of Page1, but the UserControl1 is not in the VisualTree of the Page1, it is in the VisualTree of the SampleWIn RadWindow, thus it cannot be found. This leads to SampleUC in RadButton_Click_2 to be null and trying to set
    SampleUC.txt_Name.Text = "";
    SampleUC.txt_Address.Text = "";
    causes NullReferenceException.

    I suggest passing the RadWindow instance instead of the Page1 instance in RadButton_Click_2:
    RadButton_Click_2(this.sampleWin, new RoutedEventArgs());
    Then find the txt_Name and txt_Address using FindVisualChildren method.

    I've prepared a sample project using this approach.
    Please fin it attached.

    Regards,
    Polya
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner