Help. ErrorProvider with Databinding not showing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aboutjav.com@gmail.com

    Help. ErrorProvider with Databinding not showing

    Hi,

    I added an errorprovider to my GUI layer and databinded to my business
    object

    bindingSource1. DataSource = MyBusinessObjec t;

    NameTextBox.Set DataBindings("T ext", bindingSource1, "NameProper ty",
    true, DataSourceUpdat eMode.OnPropert yChanged);

    The property is the followign


    public string NameProperty
    {
    get { return m_name; }
    set
    {
    m_name= value;
    PropertyHasChan ged("NameProper ty");
    PropertyHasChan ged("VerifyPers onName");
    }
    }

    The
    PropertyHasChan ged("VerifyPers onName");

    will check if the textbox.text value is null or empty.

    public bool VerifyPersonNam e(object target, RuleArgs e)
    {
    if (string.IsNullO rEmpty(m_name.T rim()))
    {
    e.Description = "Empty Field";
    return false;
    }
    return true;
    }


    When I clear the Name textbox field, i see the e.Description is
    called. However, the errorprovider is not visible on the GUI.

    Any help is appreciated.

    Thanks
Working...