G
Guest
I have a form where I want to populate a grid wih a dataset table.
To get the convenient designtime help I have dragged a typed dataset onto
the form, thus receiving a dataset control and a bindingsource control on the
fly.
As the dataset is quite heavy I want to reuse an existing dataset of the
main form, already loaded with data. The dataset is sent to the subform
constructor as a reference.
Problem is that when I change datasource of the grid I loose specific
formatting, set through the designer bindingsource.
My idea then was to try switching the datasource of the bindingsource
control. This seems to partly work. The bindingsource reports to have the
correct number of records. BUT they still don't show up in the grid!
Me.TblFeedbackBindingSource.DataSource = _ds
I expected some kind of refresh mechanism, but the data is not shown until I
add this line, where I specify the datasource of the grid ONCE AGAIN. Why is
this necessary to do again?
grdFeedback.DataSource = Me.TblFeedbackBindingSource
To get the convenient designtime help I have dragged a typed dataset onto
the form, thus receiving a dataset control and a bindingsource control on the
fly.
As the dataset is quite heavy I want to reuse an existing dataset of the
main form, already loaded with data. The dataset is sent to the subform
constructor as a reference.
Problem is that when I change datasource of the grid I loose specific
formatting, set through the designer bindingsource.
My idea then was to try switching the datasource of the bindingsource
control. This seems to partly work. The bindingsource reports to have the
correct number of records. BUT they still don't show up in the grid!
Me.TblFeedbackBindingSource.DataSource = _ds
I expected some kind of refresh mechanism, but the data is not shown until I
add this line, where I specify the datasource of the grid ONCE AGAIN. Why is
this necessary to do again?
grdFeedback.DataSource = Me.TblFeedbackBindingSource