Hi,
I am using a XamDataGrid (InfragisticsWP4) bound to a collection. when the page opens, there is only one record in the collection. this code was used for a couple of months with InfragisticsWPF4.v11.2.dll, version 11.2.20112.1012.
we just upgraded to a newer version 11.2.20112.2125.
our code base did not change, but now, when the page opens, 2 rows are displayed, even though, the collection contains only 1 element. the first row is not bound to any data, and the cell that contains a XamComboEditor is not populated with its ItemsSource.
Basically, only the second displayed row is the "correct" row that should be displayed.
I am wondering if some settings have changed that resulted in this behavior? Or if you have seen such behavior in the past?
thanks, taybeth.
good: that clarifies the problem.
indeed, the data source of the grid is an observable collection: now, I see why we didn't have the duplicate row in 1012 version.
thanks,
Hello again,
I have tested your scenario both with 1012 and 2125 and in the 1012 the AddNewRow functionality doesn’t work with ObservableCollection and even if you set it to True no Row appears, while in the 2125 the ObservableCollection is supported and this is why an additional Row is showed.
Hope this helps you.
Stefan,
I must not have been clear in my explanation.
you see, I exactly know what AllowAddNew property does: my question was that how come in the old version, the same property did not automatically, create a new records when the grid was loaded? whereas in the new version, it did?
anyway, we are all set now, but you did not clarify if anything has changed in the newer version.
Hello Taybeth,
Basically the AllowAddNew Property allow you to add new Records via the UI of the XamDataGrid, if its DataSource support it. Here you can read more about this Property:
http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldLayoutSettings~AllowAddNew.html
Also, when it is set to true, an addition Row is added for Adding new Records, if the DataSource support it and if you set it to false you can still add Items to the underlying object.
Thanks Stefan for getting back to me.
Actually, we found the "culprit" and fixed the issue for now, but I would really appreciate if you can investigate into this a little bit more.
On that page, we had 2 XamDataGrid, one having the problem of showing an extra row when we upgraded to the newer version of infragistics, and the other one, behaving fine as before.
Their difference was these attributes: AllowAddNew="True" AllowDelete="True"
So, when we removed those attributes, everything was fine again!? The problem is that the grid needed the ability to add new rows or delete rows, though: we handled it with 2 events that we created....
Unfortunately, I did not make a small sample to mimick our project's behavior to send you, and the project is part of a big solution with lots of references... But I just wanted to point it out to you, so that you verify if anything in the code has changed to result in such behavior.
Thanks,
taybeth.