Customizing RadAutoCompleteBox

5 posts, 1 answers
  1. Elon
    Elon avatar
    3 posts
    Member since:
    Apr 2016

    Posted 21 Apr Link to this post

    Hi, 

    I am trying to customize the RadAutoCompleteBox visual to fit our application. I went thru the process of doing "Edit a Copy" of the Style. Without making any modification to the copied style, I've encountered an Error which causes the popup no longer shows up correctly.

    System.Windows.Data Error: 26 : ItemTemplate and ItemTemplateSelector are ignored for items already of the ItemsControl's container type; Type='RadWatermarkTextBox'
    System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=WatermarkTextBox'. BindingExpression:Path=ActualWidth; DataItem=null; target element is 'AutoCompleteBoxesWrapPanel' (Name=''); target property is 'Width' (type 'Double')

  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Apr Link to this post

    Hello Elon,

    We are aware of the observed by you errors and actually they are related to a known timing issue in the WPF platform. 

    These are common errors caused by the way some controls are loaded by the Framework. Some of the bindings are broken at the start of the application but fast after that they are resolved and no critical exception is thrown. You shouldn't worry about this kind of errors. Suppressing them is possible by setting a different Trace level in your application as described in the following blog post:
    http://www.codeproject.com/Tips/124556/How-to-suppress-the-System-Windows-Data-Error-warn


    I hope this would be helpful.

    Regards,
    Yana
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Elon
    Elon avatar
    3 posts
    Member since:
    Apr 2016

    Posted 25 Apr in reply to Yana Link to this post

    Thank you for your response, Yana. However, the autocomplete popup will no longer show up. I haven't yet investigated thoroughly, but it may have something to do with the size-binding to the WatermarkTextBox. I should be able to get around that. I just wanted to confirm that it isn't something I did. 

    Thx!

    -Elon

     

  5. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 Apr Link to this post

    Hello Elon,

    I'd suggest you extract RadAutoCompleteBox Template from the used Theme XAML file instead, the approach is explained in details in our Editing Control Templates topic  - this will ensure that you have all the needed Styles in place.

    Please try it and if you still experience any issues, send us more details/sample project, so we could test the exact case.

    Regards,
    Yana
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Elon
    Elon avatar
    3 posts
    Member since:
    Apr 2016

    Posted 27 Apr Link to this post

    Thanks, Yana. 

    I have already made my own User Control as the RadAutoCompleteBox UX workflow doesn't quite fit my design. However, I'll keep your answer in mind if I've ever run into similar issue.

    I didn't realize I have to do the Theme XAML route. I was using this reference: http://docs.telerik.com/devtools/wpf/styling-and-appearance/styling-apperance-editing-control-templates.html#extracting-control-templates-using-visual-studio

    Thanks again.

    -Elon-

Back to Top
UI for WPF is Visual Studio 2017 Ready