[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

reflect changes in data bound control when underlying data table changes

Ashutosh

11/5/2008 6:56:00 AM

[Little correction]

Hi,
I have a form on which I have 2 datagrid view.
1) for table "route" - Structure : route char(3), dock int
2) for table "lanes" - Structure: laneid char(3), laneName char(6),
lanetype char(2), dock1 int, dock2 int, dock3 int, dock4 int, dock5 int

The various docks in table lanes are actually values in the table
route's dock. But it's not a foreign key. Nor is the dock unique in the
route table. There can be multiple entry for a single value of dock.
Also database can be change under any circumstances.

For DataGridView of table lanes, I needed to display the available docks
in a combo box. So, I created another dummy table (dummy_docks) whose
select query is

"select distinct dock from route order by dock"

This dummy_docks table is used as data source for dock1, dock2....,
dock5 columns (combo box columns) of the data grid view of table lanes.

When the application initializes, the adapter fills the table
dummy_docks and the values are displayed in the combo box of the data
grid view of table lanes.

But after that if any row is added to table route then the new value of
dock is not reflected in the combo box in the data grid view of lanes.

I tried to update the changes in route table by calling update on the
data adapter and clear & re-fill the table dummy_docks using the
adapter, but it doesn't help.

How can I make the changes reflect in the data bound combo box of the
data grid view.

Thanks & Regards,
Ashutosh