telerik:textsearch.textpath from code behind

8 posts, 0 answers
  1. Sven
    Sven avatar
    19 posts
    Member since:
    Feb 2011

    Posted 15 Sep 2011 Link to this post

    Hi guys,

    I am wondering if there is a way to programatically assign telerik:textsearch.textpath from code behind. I have a RadComboBox that gets different itemsource based on other conditions and at some cases I assign a custom template that I would like to allow the user to still be able to search.

    Thanks in advance
    SD 
  2. Pana
    Admin
    Pana avatar
    748 posts

    Posted 20 Sep 2011 Link to this post

    Hi Sven,

    It is an attached property and you could set it like that:

    using Telerik.Windows.Controls;

    TextSearch.SetTextPath(this.Combo, "MyProperty");

    However I am not sure that runtime change is well supported. I hope it will work for you.

    Greetings,
    Pana
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Robert
    Robert avatar
    23 posts
    Member since:
    Jun 2012

    Posted 26 Jul 2012 Link to this post

    I wonder if there's also a way to do that in Visual Basic 2010? Thanks for your help!
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 31 Jul 2012 Link to this post

    Hello Robert,

    Have you tried it like this:

    TextSearch.SetTextPath(Me.Combo, "MyProperty")


    All the best,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Robert
    Robert avatar
    23 posts
    Member since:
    Jun 2012

    Posted 01 Aug 2012 Link to this post

    That's it, thanks. I was missing the right assembly (Telerik.Windows.Controls).
  7. Edmund Covington
    Edmund Covington avatar
    16 posts
    Member since:
    Jan 2014

    Posted 12 Jan Link to this post

    How do you set the TextSearch.Text property when you are creating a FrameworkElementFactory item as a type of ComboBox?

    FrameworkElementFactory comboElement = new FrameworkElementFactory(typeof(RadComboBox)); 

     

  8. Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 15 Jan Link to this post

    Hi Edmund,

    Please, check the following code for setting the TextSearchPath and let us know if it worked for you:
    FrameworkElementFactory combo = new FrameworkElementFactory(typeof(RadComboBox));
    combo.SetValue(Telerik.Windows.Controls.TextSearch.TextPathProperty, "My Property");

    Hope this helps.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  9. Edmund Covington
    Edmund Covington avatar
    16 posts
    Member since:
    Jan 2014

    Posted 15 Jan in reply to Nasko Link to this post

    That's great. Thanks very much.
Back to Top
DevCraft banner