You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
started playing around with your extensions as I am building simple table designer control in WPF and your library is a good kickstarter as we can use really tabular items source (collection of collections). Really cool, thank you for that!
I was working on a POC where I was implementing drag/drop reorder of columns and rows and realized that your extension has a bug when inserting a row to different index than the last index (simple add). If you insert a row to the ObservableCollection bound as RowSource to index 0, ListCollectionView will throw InvalidOperationException.
You can reproduce it easily in your Demo project by changing this line to this.Data.Insert(0, new ObservableCollection<int>(newRow)); instead of Add and then on second call it will fail.
The exception is thrown because the List2DView doesn't actually insert the row internally, but adds it to the end. I had a quick look and the root cause is this line where you should call this.Rows.Insert(index, listRowView); instead of this.Rows.Add(listRowView);. I think the fix will be bit more difficult, because indexes of ListRowViews following the insertion need to be updated, which is not possible at the moment as they are only readonly properties and also the property list index descriptors I believe, so it seems also like architectural change.
Do you see a simple way of fixing it?
The text was updated successfully, but these errors were encountered:
Hey,
started playing around with your extensions as I am building simple table designer control in WPF and your library is a good kickstarter as we can use really tabular items source (collection of collections). Really cool, thank you for that!
I was working on a POC where I was implementing drag/drop reorder of columns and rows and realized that your extension has a bug when inserting a row to different index than the last index (simple add). If you insert a row to the ObservableCollection bound as RowSource to index 0, ListCollectionView will throw InvalidOperationException.
You can reproduce it easily in your Demo project by changing this line to
this.Data.Insert(0, new ObservableCollection<int>(newRow));
instead of Add and then on second call it will fail.The exception is thrown because the List2DView doesn't actually insert the row internally, but adds it to the end. I had a quick look and the root cause is this line where you should call
this.Rows.Insert(index, listRowView);
instead ofthis.Rows.Add(listRowView);
. I think the fix will be bit more difficult, because indexes of ListRowViews following the insertion need to be updated, which is not possible at the moment as they are only readonly properties and also the property list index descriptors I believe, so it seems also like architectural change.Do you see a simple way of fixing it?
The text was updated successfully, but these errors were encountered: