Nothing is everything.

Thursday, December 17, 2009

Bind a BindingSource to a Type

When we set the DataSource property of the BindingSource class to a Type instance, it will automatically create a empty IBindingList and bind it to the BindingSource. This will result in an allowance to call the AddNew method of the BindingSource to add a new object of the corresponding type. If the type implements IList, the object type will be T, not IList.

By the way, in this case, the type of the inner data source is System.RuntimeType. This is an introduction:
http://doogalbellend.blogspot.com/2006/06/what-is-systemruntimetype.html

This is the details: http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.datasource.aspx

1 comment:

  1. This took me a while to figure out too, but it turns out that you can just call Get New Binding List() on the LINQ table.
    http://www.dapfor.com/en/net-suite/net-grid/features/performance

    ReplyDelete

Followers