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
50
InitializeRecord Unbound Boolean field error
posted
I am trying to use the InitializeRecord event to init an Unbound boolean field to false.  However when I do this the expansion toggle on my records no longer work and I get the following error in the output window.  I attached a simple project showing the error - run it and try to expand one of the Categories.  If I remove the SetCellValue call (line 34), it works fine.  Am I doing something wrong when I set my boolean field, or is this a bug?

System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=IsExpanded; DataItem='DataRecordPresenter' (Name=''); target element is 'ExpansionIndicator' (Name='ExpansionIndicator'); target property is 'IsChecked' (type 'Nullable`1') TargetInvocationException:'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: key not found

at Infragistics.Windows.DataPresenter.FieldCollection.get_Item(String key)

at InitializeRecordProblem.Window1.xamDataGrid1_InitializeRecord(Object sender, InitializeRecordEventArgs e) in D:\development\Stuff\Examples\InitializeRecordProblem\InitializeRecordProblem\Window1.xaml.cs:line 34
...

InitializeRecordProblem.zip