I have a grid that I have set the IsReadOnly to true. When I am in the grid on any cell, if I press the Enter key, I get the following error.
Unable to cast object of type 'System.Windows.Input.KeyEventArgs' to type 'FullyLoadedCostLibrary.BareDriveCosts'.
StackTrace:
at Telerik.Windows.Data.FuncExtensions.<>c__DisplayClass1`2.<ToUntypedFunc>b__0(Object item) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Data\Extensions\FuncExtensions.cs:line 24
at Telerik.Windows.Data.FunctionComparer.Compare(Object x, Object y) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Data\FunctionComparer.cs:line 34
at System.Collections.Generic.ArraySortHelper`1.InternalBinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
I'm using version 2011.2.712.40 WPF
My grid is defined
I have some columns defined like this
Unable to cast object of type 'System.Windows.Input.KeyEventArgs' to type 'FullyLoadedCostLibrary.BareDriveCosts'.
StackTrace:
at Telerik.Windows.Data.FuncExtensions.<>c__DisplayClass1`2.<ToUntypedFunc>b__0(Object item) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Data\Extensions\FuncExtensions.cs:line 24
at Telerik.Windows.Data.FunctionComparer.Compare(Object x, Object y) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Data\FunctionComparer.cs:line 34
at System.Collections.Generic.ArraySortHelper`1.InternalBinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
I'm using version 2011.2.712.40 WPF
My grid is defined
<telerik1:RadGridView Name="bareDriveCostsListRadGridView" DataContext="{StaticResource bareDriveCostsListViewModelModelViewSource}" ItemsSource="{Binding ValidatesOnDataErrors=True, NotifyOnValidationError=True, ValidatesOnExceptions=True, NotifyOnTargetUpdated=True, NotifyOnSourceUpdated=True}" AutoGenerateColumns="False" CanUserDeleteRows="False" AutoExpandGroups="True" DataLoaded="bareDriveCostsListRadGridView_DataLoaded" SelectionUnit="Cell" IsReadOnly="{Binding Source={StaticResource bareDriveCostsListViewModelViewSource}, Path=CanEdit, Converter={StaticResource NotConverter}}">
I have some columns defined like this
<telerik1:GridViewMaskedTextBoxColumn Name="HistoryColumn4" DataFormatString="{}{0:n}" MaskType="Numeric" Mask="n" Header="{Binding Path=HistoryName4}" Background="LightGray" DataMemberBinding="{Binding Path=History4.Cost}" IsReadOnly="True" TextAlignment="Right" IsFilterable="False" IsSortable="False" />and some like this
<telerik1:GridViewMaskedTextBoxColumn Name="BareDriveCostColumn" Header="Bare Drive Cost" DataMemberBinding="{Binding Path=Cost}" DataFormatString="{}{0:n}" TextAlignment="Right" MaskType="Numeric" Mask="n" IsFilterable="False" IsSortable="False" > <telerik1:GridViewMaskedTextBoxColumn.CellTemplate> <DataTemplate> <Grid MouseRightButtonDown="Cell_MouseRightButtonDown" DataContext="{Binding}" ToolTip="{DynamicResource toolTipTemplate}"> <TextBlock Text="{Binding Cost}"/> <Border VerticalAlignment="Top" Width="5" Height="5" HorizontalAlignment="Right" Background="Red" Visibility="{Binding Comments,Converter={StaticResource MyConverter}}"/> </Grid> </DataTemplate> </telerik1:GridViewMaskedTextBoxColumn.CellTemplate> </telerik1:GridViewMaskedTextBoxColumn>it errors on any of them.