G
Guest
I have created a windows forms control that exposes a DataSource, DisplayMemeber and ValueMember. Everything works fine, but here is my problem: when I drag and drop a DataSet + DataAdapter and use the Fill to fill the dataset, I cannot find a way to notify my control that the data has changed. I have a "RefreshItems" method that parses the datasource and fills the control with the correct data, I also save the CurrencyManager and subscribe to the ItemChanged and MetaDataChanged events. Whatever I do, if I set the datasource before filling the dataset the items do not refresh
1)
oleAdapter1.Fill(this.dataSet1)
dataControl.DataSource = this.dataSet1.Customers
2
dataControl.DataSource = this.dataSet1.Customers
oleAdapter1.Fill(this.dataSet1)
In case 1) all works fine. In case 2) my control doesn't update because I cannot find any event that should be raised in order for me to know that the data was filled in... Should i try to cast the datasource to either DataTable, DataView or DataSet (depending on what the data is) and listen to some events of each specific type?
Any idea how can i catch that
Thank you!
iulian
1)
oleAdapter1.Fill(this.dataSet1)
dataControl.DataSource = this.dataSet1.Customers
2
dataControl.DataSource = this.dataSet1.Customers
oleAdapter1.Fill(this.dataSet1)
In case 1) all works fine. In case 2) my control doesn't update because I cannot find any event that should be raised in order for me to know that the data was filled in... Should i try to cast the datasource to either DataTable, DataView or DataSet (depending on what the data is) and listen to some events of each specific type?
Any idea how can i catch that
Thank you!
iulian