bind control to BindingSource property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • uwe.braunholz@hotmail.de

    #1

    bind control to BindingSource property

    Hello,

    I want to enable/disable some Textboxes by a property of a derived
    BindingSource-class.
    This is what i got so far:
    ----
    class myBindingSource : BindingSource
    {
    public object mxtest = false;
    public EventHandler testChanged;

    public object test
    {
    get
    {
    return mxtest;
    }
    set
    {
    if (test != value)
    {
    mxtest = Convert.ToBoole an(value);
    OntestChanged() ;
    }
    }
    }


    private void OntestChanged()
    {
    if (testChanged != null)
    {
    testChanged(thi s, new EventArgs());
    }
    }
    }

    ----
    What I want to do is bind the textboxes like that:
    myTextBox.DataB indings.Add("En abled", myBindungSource Instance, "test");

    the error "Cannot bind to property or column test on DataSource.
    Parametername: dataMember" comes up if I do so.

    What is wrong?

    I hope someone can help me!

    Thank you!
    Regards,
    Uwe Braunholz

Working...