Ticket Q207598
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

scroll bars in html editor control

ASPxHtmlEditor scroll to bottom

created 16 years ago

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);
        }

Comments (3)
DevExpress Support Team 16 years ago

    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):

    JavaScript
    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.

    ?
    Unknown 16 years ago

      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

      DevExpress Support Team 16 years ago

        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.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.