6 Answers, 1 is accepted
I've prepared a small sample project where defining the following style correctly updates the background of the RadNumericUpDown when it is in the read-only state:
Please note that if you're using the StyleManager approach for styling the controls with the Xaml assemblies, you should omit the BasedOn attribute of the style.
Could you please also test this at your end and let me know if such an approach would work for you? I look forward to your reply.
Thank you for your reply. I don't know why, but the style is not applied at runtime. Here's my control:
In desing mode the control has the right color, but at run time, it seems like the style is overwritten and the control has the default background color.
Applying the same style to a simple TextBox works fine, so the problem is realy related to the RadNumericUpDown control.
Any ideas ?
My name is Dinko and I'm stepping in for my colleague Dilyan, who is currently out of the office.
I have double checked the example provided by my colleague Dilyan and it is working as expected on my side. The style is applied runtime and design time. It is strange that the Style is not applied on your side. May I ask you some more details about your project set up.
- What version of our controls are you using?
- Can you run the project provided by Dilyan and let me know without doing any modifications if the style is applied correctly?
- I am assuming that the provided code snippet is from your application. Can you double check if they are other styles which target the RadNumericUpDown control?
- Can you try to isolate this behavior is a stand-alone project?
I am looking forward to your reply.
the problem is due to the Office2016 theme that is set in the App.xaml.cs
When I put this line in comment, the style is applied.
Obiously, I would like to keep the Office2016 style AND have the ReadOnly style applied to my RadNumericUpDown control.
I solved the problem by using implicit styles instead of the StyleManager.
I am happy to hear that you found a solution for your case. If you have any other questions you can open a new thread with your questions inside.