Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1612
Determine when scrolbars shown in UltraFormattedTextEditor
posted

I want to auto resize UltraFormattedTextEditor to fit its content

(do not show horizontal scrolbar)

 

Is it a way to determine when scrollbar is shown? (than I can enlarge control till scrollbars hide)

 

PS I tried also tip from http://news.infragistics.com/forums/p/9870/38062.aspx#38062 but doesnt help

 

 

Parents
  • 69832
    Suggested Answer
    Offline posted

    You could do something like this by calling the GetDescendant method off the control's UIElement, passing in typeof(ScrollBarUIElement), but I would advise against this for performance reasons.

    The UltraFormattedTextEditor control utilizes the FormattedLinkEditor embeddable editor, and classes that derive from EmbeddableEditorBase (as FormattedLinkEditor does) expose a GetSize method, which I believe will give you the size  required to render the value. You can get a reference to the editor by calling GetDescendant off the control's UIElement, passing in typeof(FormattedLinkEmbeddableUIElement). The UIElement returned exposes an Editor property, which exposes a GetSize method. One of those overloads takes the maxWidth, to which you should pass the control's width minus borders. You might have to fudge the value a little to make sure no scrollbars appear but I think this approach would be more performant than increasing the size until the scrollbars disappear.

Reply Children
No Data