"Vivek" <vi****@xtra.co.nz> a écrit dans le message de news:
ep**************@TK2MSFTNGP12.phx.gbl...
| Thanks. How can I update the LIST once I have updated the values? My
target
| is to update the database and the list at the same time and then reload my
| listview control from LIST.
If you want to allow full interaction with a list from controls like
DataGridView, etc, then you should create your own generic list class that
implements a couple of interfaces :
GenericList<T> : IList<T>, IBindingList, ICancelAddNew
{
private IList<T> items = new List<T>;
...
}
In implementing this class you can then talk to the database from inside
this list class, intercepting the calls that would normally go straight to a
List<T> and adding your own code to keep the database in sync.
Because of the interfaces implemented, data-aware list controls should
update themselves automatically.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer