|
-
February 7th, 2008, 10:16 AM
#1
Help. ErrorProvider with Databinding not showing Options
Hi,
I added an errorprovider to my GUI layer and databinded to my business object
bindingSource1.DataSource = MyBusinessObject;
NameTextBox.SetDataBindings("Text", bindingSource1, "NameProperty", true, DataSourceUpdateMode.OnPropertyChanged);
The property is the followign
public string NameProperty
{
get { return m_name; }
set
{
m_name= value;
PropertyHasChanged("NameProperty");
PropertyHasChanged("VerifyPersonName");
}
}
The
PropertyHasChanged("VerifyPersonName");
will check if the textbox.text value is null or empty.
public bool VerifyPersonName(object target, RuleArgs e)
{
if (string.IsNullOrEmpty(m_name.Trim()))
{
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|