RadComboBox caret brush in Expression Dark theme

9 posts, 0 answers
  1. Akram
    Akram avatar
    45 posts
    Member since:
    Dec 2012

    Posted 13 Sep 2013 Link to this post

    Hi 
    I downloaded the latest version of teleric wpf components
    I am using Expression Dark theme, but the RadComboBox caret brush set to black which make difficult to user to see it, Please let me know if i can change the caret brush.
    I can change the caret brush for TextBox, but i need to do the same for RadComboBox.

    Thanks ,
    Akram
     

  2. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 18 Sep 2013 Link to this post

    Hi Akram,

    In order to modify the CaretBrush property of the input TextBox of the ComboBox you will need to edit the EditableTemplate of the ComboBox. I would suggest that you set the desired theme using Implicit Styles, after that you can easily reach and modify the EditableTemplate of the ComboBox. You will need to find the TextBox named PART_EditableTextBox and set the CaretBrush property to the required color. For your convenience we have prepared and attached here a sample project demonstrating the exact approach.

    Hope this helps.

    Regards,
    Kalin
    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. Akram
    Akram avatar
    45 posts
    Member since:
    Dec 2012

    Posted 18 Sep 2013 Link to this post

    Thanks Kalin, 

    that's was very helpful for me.

    Regards,
    Akram
  5. Don
    Don avatar
    31 posts
    Member since:
    Aug 2012

    Posted 03 Dec 2013 Link to this post

    I have the same issue with the insertion cursor / caret being black.  I'm using version 2012.3.1129 under .Net 3.5.  Will the implicit styles work with that version of the controls and the .Net framework?  I'm asking because I tried to adapt the example code to my project, but the "CaretBrush" attribute seems to be undefined in the version I'm using.
  6. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 04 Dec 2013 Link to this post

    Hi Don,

    Could you please confirm the version of the controls you are using as the 2012.3.1129 version doesn't support .Net 3.5?

    I'm looking forward to your response.

    Regards,
    Kalin
    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 >>
  7. Don
    Don avatar
    31 posts
    Member since:
    Aug 2012

    Posted 04 Dec 2013 Link to this post

    Kalin,

    Sorry about the wrong version number.  I checked the DLLs and the reported product version is 2012.3.1108.35.

    Edit: BTW - The source for version 2012.3.1129 still has the batch files for building in .Net 3.5.  Since that was the last version I could find in the currently available downloadable sources that has build files for .Net 3.5 I assumed that was the version I had.
  8. Don
    Don avatar
    31 posts
    Member since:
    Aug 2012

    Posted 04 Dec 2013 Link to this post

    Just so I know: What is the last downloadable source of the WPF controls that had official support for .Net 3.5?  I use a custom build to protect the Telerik DLLs and because we have customizations to another control.  Thanks.
  9. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 05 Dec 2013 Link to this post

    Hello Don,

    The latest version of RadControls that officially supports .Net 3.5 is Q2 2012 SP2. As for this particular case after research it appeared the CaretBrush property of the TextBox is available in the .Net versions 4.0 and above. However as a workaround you can set the Background of the TextBox to Black as the CaretBrush takes automatically the opposite color of the Background. So you could either extract the ControlTemplate and set the Background of the mentioned TextBox or I can suggest you another approach which sets the property in the code behind without using Implicit Styles.

    If you have the following ComboBox:
    <telerik:RadComboBox x:Name="Combo" ItemsSource="{Binding ComboItems}" IsEditable="True" />

    You can set the property of the TextBox the following way:
    var editableTextBox = (TextBox)this.Combo.Template.FindName("PART_EditableTextBox", this.Combo);
    editableTextBox.Background = Brushes.Black;

    Hope this will work for you.

    Regards,
    Kalin
    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 >>
  10. Don
    Don avatar
    31 posts
    Member since:
    Aug 2012

    Posted 05 Dec 2013 Link to this post

    Kalin,

    That worked perfectly. Thank you!

    - Don
Back to Top
UI for WPF is Visual Studio 2017 Ready