When I set the HTML content of an ASPxHtmlEditor how can I make the editor's scroll bar go all the way to the bottom of the content? In the snippet below the FormatChats method get current conversation out of a database and formats it into HTML. I'd like the scrollbars of the ASPxHtmlEditor to follow the last line of the conversation. I haven't found any example of this in your KB.
protected void tcChiefChatConversations_ActiveTabChanging(object source, TabControlCancelEventArgs e)
{
heChiefChatViewer.Html = FormatChats(e.Tab.Text);
}
We have closed this ticket because another page addresses its subject:
scroll bars in html editor control
Hi Bob,
If I'm not mistaken, you should use the following js-code (e.g. in the client-side Init or EndCallback event handler):
function scrollPreview() { var previewDocBody = clientInstanceName.GetPreviewIFrameDocument().body; previewDocBody.scrollTop = previewDocBody.scrollHeight; }
Note, the clien-side GetPreviewIFrameDocument() method is internal, and we don't guarantee that this method will be accessible in the future version.
Thanks,
Michael.
Michael
Thanks for the mehtod and the caution. It does work but I added a test for null and empty so that the editor doesn't disappear. I appreciate your help.
Bob
Hi Bob,
I'm afraid it is unclear how you are modifying this code, and what's wrong with it. Could you post a small sample project reproducing this issue? We'll try to find a solution.
Thanks,
Michael.