I am binding a WinGrid to a IList<BusinessObjects>. My business object is a little bit special, and to instantiate it I am using a helper class, to be able to create the object I need in different use cases.
In this case I have to create 2 different instances of the same business object based on the use case. The properties bound to the grid's columns have an underlying object that has to be instantiated before any values can be set to the field, and this is exactly what the helper class is doing.
I added an AddNewRow as the last row in the grid. What I need is to control the way the new object is added to the list, because the one instantiated by default, using the new keyword, doesn't work for me, because it has all the underlying objects set to null.
Is there any way to do this?
Emanuel
Thanks Mike for your advice. After the object is created I am replacing it with an instance generated by my helper class and it works really well.
Hi Emanuel,
The grid just calls AddNew on the BindingManager. There's no way to change that. You would have to update your business object. Maybe you need to implement IBindingList instead of IList.