Hi,
We are currently having issues running our application on Windows 7 tablet PC's. When the grid has data, we get a NullReferenceException. I found it that the exception will not occur when removing a specific column definition from the gridview:
<telerik:GridViewColumn CellTemplate="{StaticResource StatusButtons}"
IsFilterable="False"
MaxWidth="120"
MinWidth="120"
/>
The application works fine on non-touch devices, but on touch devices (Win 7, .Net 3.5) the error occurs. Stopping the "Tablet PC Input" service does not help as mentioned in other threads.
The exception plus stacktrace
The Xaml:
How can we solve this issue?
Kind regards,
Mike
We are currently having issues running our application on Windows 7 tablet PC's. When the grid has data, we get a NullReferenceException. I found it that the exception will not occur when removing a specific column definition from the gridview:
<telerik:GridViewColumn CellTemplate="{StaticResource StatusButtons}"
IsFilterable="False"
MaxWidth="120"
MinWidth="120"
/>
The application works fine on non-touch devices, but on touch devices (Win 7, .Net 3.5) the error occurs. Stopping the "Tablet PC Input" service does not help as mentioned in other threads.
The exception plus stacktrace
2012-01-09 10:09:18,868 FATAL - User Interface : Unhandled Exception
System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.
bij System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
bij System.Windows.ContextLayoutManager.fireAutomationEvents()
bij System.Windows.ContextLayoutManager.UpdateLayout()
bij System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
bij System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
bij System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
bij System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
bij System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
bij System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
bij System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
The Xaml:
<
UserControl
x:Class
=
"BrabantWater.UI.Screens.ZInspectionListScreen"
xmlns:imageFactory
=
"clr-namespace:Sap.Eam.UI.Theme;assembly=CustomTheme_WPF"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Height
=
"auto"
Width
=
"auto"
>
<
UserControl.Resources
>
<
BooleanToVisibilityConverter
x:Key
=
"boolToVisConverter"
/>
<
DataTemplate
x:Key
=
"StatusButtons"
>
<
StackPanel
Orientation
=
"Horizontal"
Width
=
"110"
>
<
telerik:RadButton
Click
=
"RadButtonDelete_Click"
MinWidth
=
"50"
IsEnabled
=
"{Binding Path=IsDeletable, Mode=OneWay}"
>
<
Image
Source
=
"{Binding Path=DeleteImage, Mode=OneWay}"
Width
=
"32"
/>
</
telerik:RadButton
>
<
telerik:RadButton
Click
=
"RadButtonStatus_Click"
MinWidth
=
"50"
IsEnabled
=
"{Binding Path=IsEditable,Mode=OneWay}"
>
<
Image
Source
=
"{Binding Path=StatusImage, Mode=OneWay}"
Width
=
"32"
/>
</
telerik:RadButton
>
</
StackPanel
>
</
DataTemplate
>
</
UserControl.Resources
>
<
Grid
x:Name
=
"GridContainer"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
StackPanel
Grid.Row
=
"0"
Orientation
=
"Horizontal"
Margin
=
"5,5,5,5"
Height
=
"35"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Center"
>
<
telerik:RadButton
x:Name
=
"ButtonNewInstallation"
Content
=
"{lex:LocText Key=Inspection_New_Installation, Dict=InspectionResources, Assembly=Win32Resources}"
MinWidth
=
"100"
Click
=
"ButtonNewInstallation_Click"
/>
<
telerik:RadButton
x:Name
=
"ButtonNewDamage"
Content
=
"{lex:LocText Key=Inspection_New_Defect, Dict=InspectionResources, Assembly=Win32Resources}"
Margin
=
"10,0,0,0"
MinWidth
=
"100"
Click
=
"ButtonNewDamage_Click"
/>
</
StackPanel
>
<
telerik:RadGridView
x:Name
=
"InspectionGrid"
AlternationCount
=
"2"
AutoGenerateColumns
=
"False"
CanUserFreezeColumns
=
"False"
CanUserReorderColumns
=
"False"
ColumnWidth
=
"*"
EditTriggers
=
"None"
Grid.Row
=
"1"
Margin
=
"5"
MouseDoubleClick
=
"InspectionGrid_MouseDoubleClick"
RowIndicatorVisibility
=
"Collapsed"
SelectionChanged
=
"InspectionGrid_SelectionChanged"
SelectedItem
=
"{Binding Path=CurrentInspection, Mode=TwoWay}"
ShowGroupPanel
=
"false"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
UniqueName
=
"DamageCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Space, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=DamageCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"ItemCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Part, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=ItemCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"ItemDescription"
Header
=
"{lex:LocText Key=Inspection_Addition, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=ItemDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"CauseCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Task, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=CauseCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"TaskCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Finding, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=TaskCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"ActivityCodeDescription"
Header
=
"{lex:LocText Key=Inspection_Risk, Dict=InspectionResources, Assembly=Win32Resources}"
DataMemberBinding
=
"{Binding Path=ActivityCodeDescription, Mode=OneWay}"
/>
<
telerik:GridViewImageColumn
DataMemberBinding
=
"{Binding Path=AttachmentImage, Mode=OneWay}"
Header
=
"{lex:LocText Key=Inspection_Attachments, Dict=InspectionResources, Assembly=Win32Resources}"
ImageHeight
=
"32"
ImageWidth
=
"32"
IsFilterable
=
"False"
MaxWidth
=
"60"
MinWidth
=
"60"
/>
<
telerik:GridViewColumn
CellTemplate
=
"{StaticResource StatusButtons}"
IsFilterable
=
"False"
MaxWidth
=
"120"
MinWidth
=
"120"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
UserControl
>
The version of the Telerik WPF components being used: 2010.2.0716.35.
How can we solve this issue?
Kind regards,
Mike