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

NumericUpDown has NullReferenceExpception when hosted in ElementHost

1 Answer 57 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Homer Simpson
Top achievements
Rank 1
Homer Simpson asked on 14 Dec 2009, 07:43 PM
I'm having trouble with the RadNumericUpDown control.  I was able to boil it down to the following. 

1.  Create a Windows Application project
2.  Place a Element Host in the default form (Form1)
3.  Create a WPF UserControl.
4.  Place a RadNumericUpDown control in a UserControl:
<UserControl x:Class="UserControl1" 
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Height="300" Width="300"
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="Auto"/> 
 
        </Grid.RowDefinitions> 
        <telerik:RadNumericUpDown Maximum="100" Minimum="0" IsInteger="True"/> 
 
 
    </Grid> 
</UserControl> 
 

5.  Place that UserControl in the Element Host
6.  Run the program.
7.  Attempt to click the up or down button in the RadNumericUpDown control. 
8.  Watch NullReferenceException occur. 

This works fine when run in a native WPF app, but fails when hosted in Winforms.

I've tried this with 2009Q2 and 2009Q3 builds. 

I'm currently on the trial for RadControls, and this is pretty much preventing me from completing my evaluation and ultimately purchasing the product. 

1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 15 Dec 2009, 01:09 PM
Hello Homer Simpson,

I tested your report and manage to reproduce the problem. We were checking for WPF application in order to provide mouse scroll of the control. However in your case there is not WPF application just UserControl so that was causing the crash. We fixed it and it will be available in this Friday's Latest Internal Build.

Please, excuse us for the inconvenience. We have added points to your account for your report. Don't hesitate to contact us if you have other questions.


Best wishes,
Boyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
NumericUpDown
Asked by
Homer Simpson
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or