J
jehugaleahsa
Hello:
I have a mapping class that can take generic data objects and locate/
add/remove/update DataRows in a DataTable. I associate them using
attributes: TableAttribute and ColumnAttribute. I use reflection to
move the data between the data object and the DataTable.
I would like to make this extremely easy for my Forms developers.
I would like calling AddNew() to call mapper.AddDataRow(dataObject).
I would like changes to call mapper.UpdateDataRow(dataObject).
I would like removing to call mapper.DeleteDataRow(dataObject).
I am trying to implement this. Right now, I am inheriting from
BindingList<DataObject>. However, I am not sure which methods to
override and where to place my code. A quick example would be awesome.
I get the impression this should be easy to do; I just don't know how
to do it correctly.
Also, I would like to know what is the best method for preventing the
addition a bogus values to the BindingList<T>. How can I prevent them
from adding NULL or and instance of U?
Thanks!
~Travis
I have a mapping class that can take generic data objects and locate/
add/remove/update DataRows in a DataTable. I associate them using
attributes: TableAttribute and ColumnAttribute. I use reflection to
move the data between the data object and the DataTable.
I would like to make this extremely easy for my Forms developers.
I would like calling AddNew() to call mapper.AddDataRow(dataObject).
I would like changes to call mapper.UpdateDataRow(dataObject).
I would like removing to call mapper.DeleteDataRow(dataObject).
I am trying to implement this. Right now, I am inheriting from
BindingList<DataObject>. However, I am not sure which methods to
override and where to place my code. A quick example would be awesome.
I get the impression this should be easy to do; I just don't know how
to do it correctly.
Also, I would like to know what is the best method for preventing the
addition a bogus values to the BindingList<T>. How can I prevent them
from adding NULL or and instance of U?
Thanks!
~Travis