Can I programatically Add new data in generic grid

May 27, 2009 at 5:00 PM

I have a generic grid bound to an ObservableCollection via Items Source and I want the grid to be completely generic.

I now want to programatically in the generic grid to Add / Insert a new record (aka user hits the insert key). 

So in generic grid I can intercept the insert key and then delegate to its parent to add to the observable collection and that words.  What I would like to do is to do it completely in the generic grid w/out delegating back to parent.


Items.Add(????);  How do I add because I am generic grid w/out knowledge of the item type.  aka it could be

Items.Add(new Station()); or Items.Add(new Apple());  => i don't know how to do this programatically but probably very simple.