none
Form base with a BindingSource - problem RRS feed

  • Question

  • Hi,

    I am really frustrated, windowsforms designer is a big source of headaches.

    Well, my problem is the following:

    In Visual Studio 2005 I have a Form base with a BindingSource and an ErrorProvider which DataSource is precisely the BindingSource, all is fine until here.

    In other project I created a Form, which inherits of FormBase, I set DataSource of BindingSource's  FormBase with an Object Data Source with this structure:

    Object

    Details1 (inherits from BindingList<T>)

    Details2 (inherits from BindingList<T>)

    For this reason I add 2 bindingSources for 2 datagridviews so:

    BindingSourceDetails1.DataMember = "Details1"

    BindingSourceDetails1.DataSource = BindingSource

    DataGridViewDetails1.DataSource = BindingSourceDetails1

    .. And the same for Details2

    Until here nothing is wrong.

    I save the changes and close the designer

    But, when I reopen the designer following exception is shown:

    DataMember property 'Details1' cannot be found on the DataSource.
    Hide    

    at System.Windows.Forms.ListBindingHelper.GetList(Object dataSource, String dataMember)
    at System.Windows.Forms.BindingSource.ResetList()
    at System.Windows.Forms.BindingSource.EnsureInnerList()
    at System.Windows.Forms.BindingSource.System.ComponentModel.ISupportInitialize.EndInit()
     
    If I remove the bindingsource from the FormBase and I added to my inherited form no problems. 
     
    I hope any help, thanks for your attention and time.

    Saturday, July 29, 2006 9:36 PM