R
Richard Urwin
I'm using C# and having problems getting the 'Parse' EventHandler of
my binding object to be called. Interestingly, the 'Format' method is
always called however. A code snippet:
(rdDocument is a private member field of the class and has a
string-type property called 'Name')
Binding bName = new Binding("Text", rdDocument, "Name");
bName.Format += new ConvertEventHandler(teName_Format);
bName.Parse += new ConvertEventHandler(teName_Validate);
textBox1.DataBindings.Add(bName);
private void teName_Format(object sender, ConvertEventArgs e)
{
<perform formatting, OK: method always called>
}
private void teName_Validate(object sender, ConvertEventArgs e)
{
string sValue = (string) e.Value;
<perform validation, PROBLEM: method never called>
}
Can anybody tell me why it's not being called or how I can force it to
be called? Help!
Rich
my binding object to be called. Interestingly, the 'Format' method is
always called however. A code snippet:
(rdDocument is a private member field of the class and has a
string-type property called 'Name')
Binding bName = new Binding("Text", rdDocument, "Name");
bName.Format += new ConvertEventHandler(teName_Format);
bName.Parse += new ConvertEventHandler(teName_Validate);
textBox1.DataBindings.Add(bName);
private void teName_Format(object sender, ConvertEventArgs e)
{
<perform formatting, OK: method always called>
}
private void teName_Validate(object sender, ConvertEventArgs e)
{
string sValue = (string) e.Value;
<perform validation, PROBLEM: method never called>
}
Can anybody tell me why it's not being called or how I can force it to
be called? Help!
Rich