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

Exception NullReferenceExceprion

1 Answer 31 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
NSP
Top achievements
Rank 1
NSP asked on 11 Sep 2014, 11:13 AM
I have a datagrid with colopicker inside CellTemplate.
<controls:ChildWindow>
            <sdk:DataGrid  Grid.Row="1"
        ItemsSource="{Binding ColumnColors}"
        x:Name="dgColors" IsReadOnly="True"
        SelectionMode="Extended"
        AutoGenerateColumns="False" GridLinesVisibility="All">
                <sdk:DataGrid.Columns>
    <sdk:DataGridTemplateColumn Width="Auto" MinWidth="200" Extensions:GridColumnExtentions.BindableTitle="{Binding DisplayValue, Converter={StaticResource _localizationKeysConverter}, Source={StaticResource _LocalizationKeys}}">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <telerik:RadColorPicker
            Grid.Column="1" Grid.Row="5" Margin="5,0,5,5"
            AutomaticColor="Transparent"
            NoColorText="{Binding ResetColor, Converter={StaticResource _localizationKeysConverter}, Source={StaticResource _LocalizationKeys}}"  
            SelectedColor="{Binding ColorBrush, Mode=TwoWay}"
          
            VerticalAlignment="Stretch"   
            Visibility="{Binding IsOneColumnChart, Converter={StaticResource _booleanToVisibilityConverter}}" Style="{StaticResource RadColorPickerStyle1}"/>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
        </sdk:DataGrid.Columns>
  </sdk:DataGrid>
</controls:ChildWindow>
When I try to expand color picker, Exception thrown.
Error:
Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.NullReferenceException: Object reference not set to an
instance of an object.
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[]
cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
at MS.Internal.XcpImports.UIElement_UpdateLayout(UIElement element)
at Telerik.Windows.Controls.PopupWrapper.AdjustPopupLocation()
at Telerik.Windows.Controls.PopupWrapper.OnPopupOpened(Object sender,
EventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex,
Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr
unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String
eventName, UInt32 flags)

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 15 Sep 2014, 02:29 PM
Hello,

I tried to reproduce the reported behavior on our side with our latest official release and it seems that the code works as expected. Could you please take a look at the attached project and see if I missed something?

It would be great if you change the code so that the issue can be reproduced and send it back. This will help me to better understand your scenario and further investigate the reasons behind.

Thank you for your kind cooperation.

Regards,
Pavel R. Pavlov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ColorPicker
Asked by
NSP
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or