Text manipulation in WatermarkTextBox

4 posts, 0 answers
  1. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 06 Jun 2014 Link to this post

    Hi,

    I'm on .Net 4.0 and I use Telerik V2014.1.331.40 and I would like to know how I can access the RadWatermarkTextBox inside the control? For my scenario, I need to do some manipulation on the text inside the RadWatermarkTextBox.

    Thank's
    Alain
  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 09 Jun 2014 Link to this post

    Hello Alain,

    Can you give us more information about what kind manipulation you want to achieve?

    If you need to modifye the style of the control you can find all resources in the Themes.Implicit folder under your installation directory. For RadWatermartTextBox, you need to check the Themes.Implicit\OfficeBlack\Themes\Telerik.Windows.Controls.xaml file.

    I hope it helps.

    Regards,
    Masha
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 09 Jun 2014 in reply to Masha Link to this post

    Hi Masha,

    with the RadAutoCompleteBox and I use a AutoCompleteBoxGroupingFilteringBehavior. What I'm trying to do is to filter the contain of the dropdown depending ON which word the carret is into the the AutoCompeteBox.

    Let me show an example:

    AutoCompleteBox text: Masha Alain User1 User2 User3

    So, if the carret is on the "Alain" word, I need to display in the dropdown only the items which contain the "Alain" word. Samething for "Masha". If the user enter the following: "User1 User2 Masha+Alain User3" and the carrte is on "Masha", I need to display in the dropdown on the items containing the "Masha" and "Alain".

    Thank's
    Alain
  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 10 Jun 2014 Link to this post

    Hello Alain,

    In order to find RadWatermarkTextBox inside RadAutoCompleteBox, you can use ChildrenOfType<T> method, for example:
    private void RadAutoCompleteBox_Loaded(object sender, RoutedEventArgs e)
    {
        var autoCompleteBox = sender as RadAutoCompleteBox;
        if (autoCompleteBox != null)
        {
            var watermark = autoCompleteBox.ChildrenOfType<RadWatermarkTextBox>().FirstOrDefault();
            if(watermark != null)
            {
                // watermark is found!
            }
        }
    }

    Hope this helps!

    Regards,
    Rosen Vladimirov
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top