What is the best way to put place holders into a bindable collection?
My collection uses these interfaces:
ICollectionView, IEnumerable, INotifyCollectionChanged, IEditableCollectionView, IPagedCollectionView, INotifyPropertyChanged
(And the "real" objects in the collection are entities e.g. Car entity)
At first, I made my collection return null at the place holders, however this results in a non visible element in the table, further more, when a null item was replaced with an actual item, the telerik gridview is not handling the CollectionChanged(replace, null -> Car)
i.e. Instead of going from 3 loaded +1 placeholder -> 4 loaded
It goes from 3 + 0 (you can't see the place holder) -> to 3
However, the moment you do something to the control (e.g. move a scroll bar, make it non visible then re visible again etc.) it will redraw the control correctly and show all 4 items. (The only way I've managed to counter this flaw, is if the collectionchanged.action == replace, and olditems.contains a placeholder, I rethrow a collectionreset, but this does seems like a flaw in the telerik controls)
Also, this can crash if my collection has sorts/filters, as it tries to filter the null and gives a null object exception
My second attempt was to have a PlaceHolder object. However, if I sort/filter again the gridview, it will crash and say that the property does not exist.
(Note in all the above examples, I'm adding sorts to my Collections SortDescriptions, not by clicking the grid)
My collection uses these interfaces:
ICollectionView, IEnumerable, INotifyCollectionChanged, IEditableCollectionView, IPagedCollectionView, INotifyPropertyChanged
(And the "real" objects in the collection are entities e.g. Car entity)
At first, I made my collection return null at the place holders, however this results in a non visible element in the table, further more, when a null item was replaced with an actual item, the telerik gridview is not handling the CollectionChanged(replace, null -> Car)
i.e. Instead of going from 3 loaded +1 placeholder -> 4 loaded
It goes from 3 + 0 (you can't see the place holder) -> to 3
However, the moment you do something to the control (e.g. move a scroll bar, make it non visible then re visible again etc.) it will redraw the control correctly and show all 4 items. (The only way I've managed to counter this flaw, is if the collectionchanged.action == replace, and olditems.contains a placeholder, I rethrow a collectionreset, but this does seems like a flaw in the telerik controls)
Also, this can crash if my collection has sorts/filters, as it tries to filter the null and gives a null object exception
My second attempt was to have a PlaceHolder object. However, if I sort/filter again the gridview, it will crash and say that the property does not exist.
(Note in all the above examples, I'm adding sorts to my Collections SortDescriptions, not by clicking the grid)