M
Marc Vangrieken
Hi,
I have a question regarding databinding via the Visual Studio 2005 form
designer. What I wanted to do is not a very good practice, it was just
"quick and dirty" in really small application. I had a WinForms
form with a typed dataset and a lot of controls bound to it via
BindingSources. Because a lot of these fields are optional, and I
wanted to clean the form up, I added a little button invoking a second
(modal) form containing those fields. The latter only contained a
BindingSource that got hooked up to the typed dataset on the main form
(by passing a reference at creation) in runtime. (I passed the entire
dataset because i needed a few tables with reference data).
Knowing that the schema of the dataset will never change again I just
wanted to bind the controls on the second form to the bindingsource in
design time. Of course, the designer can't provide me with
DisplayMembers, etc...
I found that it was possible to manually set the DataBindings property
for Text and Tag using the " bindingsource - field" syntax, the
correct code is generated. For other fields, e.g. SelectedValue in a
combobox, this is not possible via the properties window.
I am curious now, is this a bug in VS2005 or is this supported? If so,
why doesn't the "bindingsource - field" syntax work for all
properties?
I have a question regarding databinding via the Visual Studio 2005 form
designer. What I wanted to do is not a very good practice, it was just
"quick and dirty" in really small application. I had a WinForms
form with a typed dataset and a lot of controls bound to it via
BindingSources. Because a lot of these fields are optional, and I
wanted to clean the form up, I added a little button invoking a second
(modal) form containing those fields. The latter only contained a
BindingSource that got hooked up to the typed dataset on the main form
(by passing a reference at creation) in runtime. (I passed the entire
dataset because i needed a few tables with reference data).
Knowing that the schema of the dataset will never change again I just
wanted to bind the controls on the second form to the bindingsource in
design time. Of course, the designer can't provide me with
DisplayMembers, etc...
I found that it was possible to manually set the DataBindings property
for Text and Tag using the " bindingsource - field" syntax, the
correct code is generated. For other fields, e.g. SelectedValue in a
combobox, this is not possible via the properties window.
I am curious now, is this a bug in VS2005 or is this supported? If so,
why doesn't the "bindingsource - field" syntax work for all
properties?