Hello,
I have a collection of objects which implemepts IEditableCollectionView
In my AddNew i prepare the item i want to add to the collection .
Than i enter the indexer of the object i am adding and setting it's attributes (i have a dynamic XamGrid columns)
Than in my CommitAdd i add the prepared item to the collection.
I do it like this:
private Boolean _isAdding = false; public object AddNew() { _isAdding = true; return _attributeRow = new FilterSetDefinitionAttributeRowViewModel() { ParentViewModel = _parent }; return null; } private FilterSetDefinitionAttributeRowViewModel _attributeRow; public void CommitNew() { Add(_attributeRow); //Add(_attributeRow); _isAdding = false; } public void CancelNew() {
But after it's complete i get an exception saying "Parameter count mismatch." from MSCORLIB
Hello again,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thanks.
It helped. works fine
Hello Michael,
You can use the XamGrid’s DataObjectRequested event, which fires when you add new row. Here you can read more about this event:
http://help.infragistics.com/NetAdvantage/Silverlight/2011.2/CLR4.0/?page=InfragisticsSL4.Controls.Grids.XamGrid.v11.2~Infragistics.Controls.Grids.XamGrid~DataObjectRequested_EV.html
Hope this helps you.
OK i will try to use it,
But still . First of all i never enters the RowAdding && RowAdded events of XamGrid.
Secondly,
What is the flow when XamGrid creates NewRow when IEditableCollectionView is not implemented?
When it calls AddNewRow, CanAddRow , IsAddingRow and CommitNewRow ?
I am still not completely sure that I understand your scenario correctly, but I suggest you see this forum thread:
http://stackoverflow.com/questions/2680759/wpf-ieditablecollectionview-and-canaddnew-and-empty-collections
and the sample from the MSDN about implementing IEditableCollectionView:
http://msdn.microsoft.com/en-us/library/cc716787(v=vs.90).aspx