{"NullReferenceException"} in lates hotfix for WP7

3 posts, 1 answers
  1. kity
    kity avatar
    71 posts
    Member since:
    Mar 2012

    Posted 28 Sep 2012 Link to this post


    After update teleric Windows Phone 7 library with lates hotfix version "RadControls_for_WindowsPhone_2012_2_0919_DEV_hotfix" get this message error in one of my constructors.

     

    #region constructors   
            public AlarmView()
             {
                 InitializeComponent(); // <- here I get error message about null reference  {"NullReferenceException"}           
            }
             #endregion

    Before new version everyting is work just fine.

    I get this error in runtime and in InitializeComponent()  & at design:

    Object reference not set to an instance of an object.

     

    at Telerik.Windows.Controls.VirtualizationStrategy.UpdateScrollBarVisibility() in c:\Builds\67\WindowsPhone\All_Controls_WPFixes\Sources\Development\Controls\Primitives\VirtualizingDataControl\VStrategies\VirtualizationStrategy.cs:line 788 at Telerik.Windows.Controls.RadVirtualizingDataControl.OnScrollBarModeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) in c:\Builds\67\WindowsPhone\All_Controls_WPFixes\Sources\Development\Controls\Primitives\VirtualizingDataControl\VirtualizingDataControlScrolling.cs:line 192 at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue) at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter) at Telerik.Windows.Controls.RadVirtualizingDataControl.set_ScrollBarMode(ScrollBarMode value) in c:\Builds\67\WindowsPhone\All_Controls_WPFixes\Sources\Development\Controls\Primitives\VirtualizingDataControl\RadVirtualizingDataControl.cs:line 257

    <telerik:RadDataBoundListBox x:Name="AlarmList" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="9"
                   ScrollBarMode="AlwaysVisible"
                   ItemsSource="{Binding Data, Mode=OneWay}" MinWidth="1500"
                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
     
                   <telerik:RadDataBoundListBox.ItemTemplate>
     
                       <DataTemplate x:Name="AlarmDataItemTemplate">
                           <Grid>
     
                               <Grid.ColumnDefinitions>
                                   <ColumnDefinition Width="180"/>
                                   <ColumnDefinition Width="370"/>
                                   <ColumnDefinition Width="160"/>
                                   <ColumnDefinition Width="300"/>
                                   <ColumnDefinition Width="100"/>
                                   <ColumnDefinition Width="100"/>
                                   <ColumnDefinition Width="100"/>
                                   <ColumnDefinition Width="150"/>
                                   <ColumnDefinition Width="100"/>
                               </Grid.ColumnDefinitions>
     
                               <TextBlock  Grid.Column="0" Text="{Binding Time, StringFormat='{}{0:dd.MM.yyyy HH:mm:ss}'}" />
                               <TextBlock  Grid.Column="1" Text="{Binding Tag}"         />
                               <TextBlock  Grid.Column="2" Text="{Binding Terminal}"    />
                               <TextBlock  Grid.Column="3" Text="{Binding Description}" />
                               <TextBlock  Grid.Column="4" Text="{Binding Failure}"     />
                               <TextBlock  Grid.Column="5" Text="{Binding Priority}"    />
                               <TextBlock  Grid.Column="6" Text="{Binding Name}"        />
                               <TextBlock  Grid.Column="7" Text="{Binding GroupName}"   />
                               <TextBlock  Grid.Column="8" Text="{Binding System}"      />
     
                           </Grid>
                       </DataTemplate>
     
                   </telerik:RadDataBoundListBox.ItemTemplate>
               </telerik:RadDataBoundListBox>
  2. Answer
    Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 28 Sep 2012 Link to this post

    Hi Pet,

    Thanks for writing.

    It seems that you're updating from a rather old version. The ScrollBarMode property is already deprecated and should not be used. You should use the ScrollViewer's ScrollbarVisibility attached properties instead:
    ScrollViewer.VerticalScrollBarVisibility="Visible"

    I hope this helps.

    Kind regards,
    Deyan
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. DevCraft banner
  4. kity
    kity avatar
    71 posts
    Member since:
    Mar 2012

    Posted 28 Sep 2012 Link to this post

    Problem is fixed!

    Please provide a link with detail information with all changes in new version.
    My IT PM give me this link http://www.telerik.com/products/wpf/whats-new/release-history/q2-2012-version-2012-2-607-2457892840.aspx , but there is not any information about "ScrollBarMode" or "ScrollViewer"

Back to Top