Hi Ralf,
Based on my understanding, you'd like to bind some textboxes to the data
class in your program and want to achieve the data binding function of
retrieving data from the datasource to the textboxes and get the updated
values from the textboxes back to the data source. If I'm off base, please
feel free to let me know.
I have two questions here.
1. Is your data class a list/collection?
2. You have mentioned that you use a BindingSource component in your
program. Do you bind the BindingSource to the data class(if it is a list)
or a list of the data class objects(if the data class is not a list) and
then bind those textboxes to the BindingSource?
If the data class is not a list, you could use an instance of type
System.Collections.Generic.List<T> as the container of the data class
objects. You could also generate a data source based on the data class, as
Robin has suggested. Then you bind the BindingSource component to the
list/data source and then bind the textboxes to the BindingSource component.
In fact, as long as you bind a property of a control to a data source
successfully, the control's property is populated automatically by the data
source and if the user changes the value of the control's property when the
problem is run, the updated value is written back to the data source
automatically. All the above work is done by data binding architecture.
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx. ==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.