I have a DataSet with 3 DataTables and two relations.
Like this:
Parent
Child
ChildValues
There is no problem, when i adding Parent.DefaultView as ItemsSource if all Tables are empty.
As soon i have one or more row in the DataSet and the grid property AddNewRowSettings.AllowAddNewRow is set to: Bottom, i getting this error:
Source:
InfragisticsWPF4.DataManager.v12.1
Message:
"DataManager hat versucht, eine Instanz des Typs 'System.Data.DataRowView' ohne leere Parameterliste zu erstellen."
Stacktrace:
at Infragistics.DataManagerBase.GenerateNewObject() at Infragistics.Controls.Grids.RowsManager.GenerateNewObject(RowType rowType) at Infragistics.Controls.Grids.RowsManager.ResetAddNewRows(Boolean generateNewData) at Infragistics.Controls.Grids.XamGridRowsManager.ResetAddNewRows(Boolean generateNewData) at Infragistics.Controls.Grids.RowsManager.InitializeData() at Infragistics.Controls.Grids.RowsManager.SetupDataManager() at Infragistics.Controls.Grids.RowsManager.EnsureDataManager() at Infragistics.Controls.Grids.RowsManager.OnItemsSourceChanged(Boolean invalidateSelectionAndActivation) at Infragistics.Controls.Grids.RowsManager.set_ItemsSource(IEnumerable value) at Infragistics.Controls.Grids.XamGrid.ApplyItemSource(IEnumerable itemSource) at Infragistics.Controls.Grids.XamGrid.ItemsSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.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.SetValue(DependencyProperty dp, Object value) at Infragistics.Controls.Grids.XamGrid.set_ItemsSource(IEnumerable value) at IBV.Modules.ExtendedSearch.ExtendedSearchControl.LoadControl() in C:\DevNet\ExternalAssemblies\ExtendedSearch\ExtendedSearchControl.xaml.cs:line 104
Inner Exception Source:
mscorlib
Inner Exception Message:
Constructor on type 'System.Data.DataRowView' not found.
When the DataSet is empty or the grid does not allow AddNewRow there is no excpetion thrown.
Whats wrong here?
Hello,
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.
I have been looking into your issue and if you use a DataTable.DefaultView as an ItemSource and you would like to use the Add Row functionality of the XamGrid, this way the dataObjects in your source don't have an empty constructor and you need to handle ‘DataObjectRequested’ event like :
private void xamGrid1_DataObjectRequested(object sender, DataObjectCreationEventArgs e)
{
if (dateSet.Tables[0] != null && e.ObjectType.Equals(typeof(DataRowView)))
e.NewObject = new DataView(dateSet.Tables[0]).AddNew();
}
If you need any further assistance on this matter, feel free to ask.
I have logged this behavior with our developers in our tracking system, with an issue ID of 112149. I have also created a support ticket on your behalf with number CAS-91770-X7KHRW in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
Hello ,
I have contacted our development team about more information regarding the issue that you are having and I will follow up with you shortly.
Thank you for your patience.