Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Getting : Object reference not set to an instance of an object.
posted

Hi Guys,

I am using combox in side the  igDP:XamDataGrid  .. in this version if i set IsSynchronizedWithCurrentItem="false" then it works fine and  when it is true then getting exception. to implement my business logic i have to set it true.

Business logic :  If user selects any value from combox at UI. but the selected value is not correct according to business logic then a message box is displayed with text message "this is not correct value". So user clicks on ok button on message box then after the pervious value should be displayed in same row of grid. but when user clicks on ok button then after  OnValueChanged() method call and exception occures.

Kindly help. Many Many Thanks in advanced!!!!!

here is XMAL code:

<igDP:XamDataGrid Name="customerGroupAgreementDataGrid"
TabIndex="13"
RecordContainerGenerationMode = "PreLoad" DataSource="{Binding Path=CustomerGroupAgreementsItemsSource,Mode=TwoWay}"
acb:CommandBehavior.Event="CellUpdated"
acb:CommandBehavior.Command="{Binding Path= GroupAgreementAddedCommand}"
acb:CommandBehavior.CommandParameter="{Binding ElementName=customerGroupAgreementDataGrid, Path=ActiveRecord.DataItem}"
BorderBrush="LightSteelBlue"
BorderThickness="2"
Background="AliceBlue"
Theme="Office2k7Blue"
AutoFit="False"
GroupByAreaLocation="None"
IsSynchronizedWithCurrentItem="True"
Grid.Column="2"
Grid.ColumnSpan="3"
Grid.RowSpan="4"
Margin="5"
Grid.Row="5"
Height="150"
CellChanged="customerGroupAgreementDataGrid_CellChanged" >

<igDP:XamDataGrid.Resources>
<Style TargetType="{x:Type igDP:DataRecordPresenter}">
<Setter Property="ToolTip"
Value="{Localize dataGridTooltip}" />
</Style>
</igDP:XamDataGrid.Resources>
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False"
AllowAddNew="True"
AllowDelete="False"
AddNewRecordLocation="OnBottom"
SelectionTypeCell="Extended"
SelectionTypeField="None"
SelectionTypeRecord="Single" />
</igDP:XamDataGrid.FieldLayoutSettings>

<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="Value"
Label="{Localize customerGroupAgreement}"
Width="300">
<igDP:Field.Settings>
<igDP:FieldSettings LabelClickAction="Nothing"
EditorType="{x:Type infraEditor:XamComboEditor}">
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type infraEditor:XamComboEditor}">
<Setter Property="ItemsProvider"
Value="{Binding Source={StaticResource MP}}" />
<Style.Triggers>
</Style.Triggers>
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>










Error :


Message : PresentationException occured in App.Application_DispatcherUnhandledException () failed., message: , transactionID: Not available
Source :
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite :
Stack Trace : The stack trace is unavailable.
Additional Info:

Inner Exception
---------------
Type : System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Object reference not set to an instance of an object.
Source : InfragisticsWPF4.DataPresenter.v14.1
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void OnValueChanged()
Stack Trace : at Infragistics.Windows.DataPresenter.CellValuePresenter.OnValueChanged()
at Infragistics.Windows.Editors.ValueEditor.OnValueChanged(Object previousValue, Object currentValue)
at Infragistics.Windows.Editors.ValueEditor.OnValueChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at Infragistics.Windows.Editors.ValueEditor.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at Infragistics.Windows.Editors.TextEditorBase.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at Infragistics.Windows.Editors.XamComboEditor.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetCurrentValue(DependencyProperty dp, Object value)
at Infragistics.DependencyPropertyUtilities.SetCurrentValue(DependencyObject d, DependencyProperty property, Object newValue)
at Infragistics.Windows.Editors.XamComboEditor.Sync_SetValueHelper(DependencyProperty prop, Object value, ValueChangeSource changeSource)
at Infragistics.Windows.Editors.XamComboEditor.OnValueChanged_SyncPropertiesHelper(ValueChangeSource source, Object value)
at Infragistics.Windows.Editors.XamComboEditor.OnValueChanged_SyncProperties(ValueChangeSource source, Object value, Boolean calledFromSyncValuePropertiesOverride)
at Infragistics.Windows.Editors.XamComboEditor.OnComboBox_SelectionChanged(Object sender, SelectionChangedEventArgs e)
at System.Windows.Controls.SelectionChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.Controls.ComboBox.OnSelectionChanged(SelectionChangedEventArgs e)
at System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(List`1 unselectedItems, List`1 selectedItems)
at System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
at System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(Object item, Boolean assumeInItemsCollection)
at System.Windows.Controls.ComboBox.NotifyComboBoxItemMouseUp(ComboBoxItem comboBoxItem)
at System.Windows.Controls.ComboBoxItem.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


Category: Error
Priority: 0
EventId: 40090
Severity: Error

Below is teh quic watch exception details.

- TargetSite {Void OnValueChanged()} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
+ [System.Reflection.RuntimeMethodInfo] {Void OnValueChanged()} System.Reflection.RuntimeMethodInfo
- base {Void OnValueChanged()} System.Reflection.MemberInfo {System.Reflection.RuntimeMethodInfo}
+ DeclaringType {Name = "CellValuePresenter" FullName = "Infragistics.Windows.DataPresenter.CellValuePresenter"} System.Type {System.RuntimeType}
MemberType Method System.Reflection.MemberTypes
MetadataToken 100664596 int
+ Module {InfragisticsWPF4.DataPresenter.v14.1.dll} System.Reflection.Module {System.Reflection.RuntimeModule}
Name "OnValueChanged" string
- ReflectedType {Name = "CellValuePresenter" FullName = "Infragistics.Windows.DataPresenter.CellValuePresenter"} System.Type {System.RuntimeType}
+ [System.RuntimeType] {Name = "CellValuePresenter" FullName = "Infragistics.Windows.DataPresenter.CellValuePresenter"} System.RuntimeType
+ base {Name = "CellValuePresenter" FullName = "Infragistics.Windows.DataPresenter.CellValuePresenter"} System.Reflection.MemberInfo {System.RuntimeType}
+ Assembly {InfragisticsWPF4.DataPresenter.v14.1, Version=14.1.20141.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb} System.Reflection.Assembly {System.Reflection.RuntimeAssembly}
AssemblyQualifiedName "Infragistics.Windows.DataPresenter.CellValuePresenter, InfragisticsWPF4.DataPresenter.v14.1, Version=14.1.20141.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" string
Attributes Public System.Reflection.TypeAttributes
+ BaseType {Name = "DataItemPresenter" FullName = "Infragistics.Windows.DataPresenter.DataItemPresenter"} System.Type {System.RuntimeType}
ContainsGenericParameters false bool
+ DeclaringMethod '(((System.Reflection.MemberInfo)((e._exception).TargetSite)).ReflectedType).DeclaringMethod' threw an exception of type 'System.InvalidOperationException' System.Reflection.MethodBase {System.InvalidOperationException}
+ DeclaringType null System.Type
FullName "Infragistics.Windows.DataPresenter.CellValuePresenter" string
- GenericParameterAttributes '(((System.Reflection.MemberInfo)((e._exception).TargetSite)).ReflectedType).GenericParameterAttributes' threw an exception of type 'System.InvalidOperationException' System.Reflection.GenericParameterAttributes {System.InvalidOperationException}
+ base {"Method may only be called on a Type for which Type.IsGenericParameter is true."} System.SystemException {System.InvalidOperationException}
+ GenericParameterPosition '(((System.Reflection.MemberInfo)((e._exception).TargetSite)).ReflectedType).GenericParameterPosition' threw an exception of type 'System.InvalidOperationException' int {System.InvalidOperationException}
+ GUID {ddc13ec4-7006-31a5-9956-a74c54fe2ba4} System.Guid