Hi All,
I have created a class which inherits from RADTextBox and override the OnKeyPress() method.
public class RegExpRadTextBox : RadTextBox
{
string _keyRegExp;
public string KeyRegExp
{
get { return this._keyRegExp; }
set { this._keyRegExp = value; }
}
protected override void OnKeyPress(KeyPressEventArgs e)
{
if (!string.IsNullOrEmpty(this._keyRegExp))
{
if (!Regex.IsMatch(e.KeyChar.ToString(), this._keyRegExp))
{
e.Handled = true;
}
}
base.OnKeyPress(e);
}
}
But when i type some text, nothing happens (Keypress Event Firing/Raised).
(Keydown is also doesnt work.)
What should i do?
Thanks.