G
Guest
In the Visual Studio 2005 designer, I have a grid, a binding source, and a
data set which contains two data tables.
In the Designer, I make the settings below. If I set the DataMember for the
binding source to Table1, I see the data in Table 1. If I set the DataMember
for the binding source to Table2, I see the data in Table 2. This all works
great.
I need to be able to reassign the DataMember for the binding source at
run-time. If I assign it to the same table that's set in the designer, I see
data. If I assign the DataMember to the other table, I don't see any data in
the grid.
Has anybody successfully switched DataMember assignments for a Binding
Source at run-time? If so, is there something like refresh that I'm missing?
Thanks,
Randy
myGrid.DataSource = myBindingSource.
myBindingSource.DataSource = myDataSet
myBindingSource.DataMember = myDataSet.Table1
**OR**
myBindingSource.DataMember = myDataSet.Table2
data set which contains two data tables.
In the Designer, I make the settings below. If I set the DataMember for the
binding source to Table1, I see the data in Table 1. If I set the DataMember
for the binding source to Table2, I see the data in Table 2. This all works
great.
I need to be able to reassign the DataMember for the binding source at
run-time. If I assign it to the same table that's set in the designer, I see
data. If I assign the DataMember to the other table, I don't see any data in
the grid.
Has anybody successfully switched DataMember assignments for a Binding
Source at run-time? If so, is there something like refresh that I'm missing?
Thanks,
Randy
myGrid.DataSource = myBindingSource.
myBindingSource.DataSource = myDataSet
myBindingSource.DataMember = myDataSet.Table1
**OR**
myBindingSource.DataMember = myDataSet.Table2