We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Appending Text to HTMLUI Control

I''m using the HTMLUI Control (awesome control, btw), as a control to show a running log of events, with formatting. Everytime something happens, I append the text property of the control: Example: htmlui1.Text += newText; where: newText contains formatted HTML tags, etc... Is this the best way to append text? I''m concerned because the control could get to the point where there is a lot of text. And each append is going to be potentially very slow. Would it be better to use the Document.Document class and append to the XML? If so, can you provide an example? (Version 4.2) Thanks Eric

1 Reply

NR Nandakumar R Syncfusion Team May 25, 2006 05:39 AM UTC

Hi Eric, With the HTMLUI control, the user can access all the html elements in the document. My suggestion in appending a text to the HTMLUI control is to append the text to the body element of the html document displayed in the control. This can be done as follows, [C#] //Gets the body tag element in the document displayed in the HTMLUI control IHTMLElement bodyelement = this.htmluiControl1.Document.RenderRoot; //Appends text to the body tag element bodyelement.InnerHTML += "
This is a sample text to append to the body element
";
Please refer the sample attached below that adds text to the HTMLUI control display as suggested above. Please try this and let me know if this helps. Thank you, Nanda AppendText.zip

Loader.
Live Chat Icon For mobile
Up arrow icon