private void BindToTable(DataTable t)
{
t.ColumnChanged += new DataColumnChangeEventHandler(OnColumnChanged);
t.RowChanging += new DataRowChangeEventHandler(OnRowChanging);
t.RowChanged += new DataRowChangeEventHandler(OnRowChanged);
t.RowDeleting += new DataRowChangeEventHandler(OnRowChanging);
t.RowDeleted += new DataRowChangeEventHandler(OnRowChanged);
t.PropertyChanging += new PropertyChangedEventHandler(OnTablePropertyChanging);
t.Columns.CollectionChanging += new CollectionChangeEventHandler(OnTableColumnsChanging);
foreach (DataColumn col in t.Columns)
{
// Hook column properties changes, so we can react properly to ROM changes.
col.PropertyChanging += new PropertyChangedEventHandler(OnColumnPropertyChanging);
}
}