I am developing an Infopath which contains richtextbox. I have set some data validations rules on that. I want the user to be restricted to put the text beyond perticular character limit. I have tried to do it through conditional formatting but could not achieve. I even tried to achieve it through _OnAfterChange event of the richtextbox.
public void test_richtextabstract_OnAfterChange()
{
string nodeText = e.newValue;
if (!string.IsNullOrEmpty(nodeText) && nodeText.Length > 1000)
{
string truncatedText = nodeText.Substring(0, 1000);
e.newValue =truncatedText ;
}
}