How to display superscript and subscript in selected text in AutocompleteBox

4 posts, 0 answers
  1. Shengwei
    Shengwei avatar
    12 posts
    Member since:
    Sep 2012

    Posted 18 Nov 2013 Link to this post

    Hi, 

    I wonder does AutocompleteBox support displaying Subscript and superscript if the autocomplete dropdown contains these values?

    How to achieve that? thank you.

  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 20 Nov 2013 Link to this post

    Hello,

    The current version of RadAutoCompleteBox doesn't support superscript and subscript out of the box. Its built-in filtering mechanism uses the property set in its TextSearchPath or DispalyMemeberPath to search through the items. In order to be able to search through the superscript, subscript and a property of the bound Item, you could implement a custom logic that combines all of those values into one string property and set that property to the TextSearchPath.

    Hope this is helpful.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Shengwei
    Shengwei avatar
    12 posts
    Member since:
    Sep 2012

    Posted 25 Nov 2013 Link to this post

    Thank you for the reply. 

    Currently we are using data like "string<sub>2</sub>" to indicate part of the string is a super script or subscript, 
    The filtering has no problem by using TextSearchPath and SearchText as i will simply treat <sub></sub> as string.

    what i want is how do i style the autocompletbox textbox to display a subscript or superscript using Converter? In this case it is just a styling issue instead of a data issue.

    Is my approach correct and how can i style the text inside the autocomplete textbox? 

    thank you
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 25 Nov 2013 Link to this post

    Hi,

    When the SelectionMode is set to Multiple (its default value) you could create a custom DataTemplate and set it to the BoxesItemTemplate property of the RadAutoCompleteBox control.

    When the SelectionMode is set to Single the displayed text is a simple TextBox and in the current version of the control it is not possible to customize its looks.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top