Line Breaks in Code Infopath code behind

R

rjayram

Hi,

Is there any way I can introduce line breaks in a multi line text box
in an Infopath 2007 form using C# code behind. For eg. I want text in this
format:
Hello
World
in my multiline text box. Any pointers would be greatly appreciated.

Thanks,
Jayram.
 
R

rjayram

Yes I did try setting the value of the text to something that included \r\n,
but without success. Do you or anyone else have any code sample that could
help?

Thanks,
Jayram.
 
R

rjayram

The following is the code I am writing to introduce a new line in a text
field. The code is in C#.

XPathNavigator _root = MainDataSource.CreateNavigator();
XPathNavigator _submitLogString =
_root.SelectSingleNode("/my:myFields/my:LogGroup/my:LogString",
this.NamespaceManager);
_submitLogString.SetValue("This is a log string. \\r\\n " + " The document
was saved " + System.DateTime.Now.ToString());

I dont know what doesnt work.

Thanks,
Jayram.
 
R

rjayram

Andy and Bryan,

Thanks for your help but I got it. I was writing
\\r\\n to account for C#'s tendency to strip one of the slashes, but it turns
out I neednt have done that. It never occurred to me to try this out before.
Stupid mistake. Thanks again for taking out the time to reply to my question.

Thanks,
Jayram.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top