Using WinForms and data bindings.
I have a form containing a BindingSource component and I have set the DataSource property from the designer to a class:
public class MyClass
{
public string MyString {get;set;}
}
Now, how do I get the MyClass object assigned to the BindingSource from source code?
I've tried casting the DataSource property of the BindingSource to MyClass, not working.
Additional notes
My problem seems to be that I set the DataSource from the WinForms Designer.
The DataSource is then set to the type MyClass and not an actual object.
So, is there an object created that I can access and modify from code so that values from the bounded object shows on the form's controls ?
Thank you.