This is a migrated thread and some comments may be shown as answers.

DatePicker ReadOnly VisualState

1 Answer 116 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
B
Top achievements
Rank 2
B asked on 17 Jul 2012, 12:24 PM

Hi, 

I want all controls to not react visually to IsReadOnly being set, or at least have control over what color is used (so I can make it transparent).

For controls RadMaskedTextBox and RadMaskedNumericInput there is the following property in the style:

<SolidColorBrush x:Key="TextBoxBackground_ReadOnly" Color="White"/>

Removing only the references and leaving the definition works. For example:

<SolidColorBrush x:Key="TextBoxBackground_ReadOnly" Color="Transparent"/>
<!--<Setter Property="Background" Value="{StaticResource TextBoxBackground_ReadOnly}"/>--> 
<!--<VisualState x:Name="ReadOnly">  <Storyboard>  <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBorder">  <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxBackground_ReadOnly}"/>  </ObjectAnimationUsingKeyFrames>  </Storyboard> </VisualState>-->

 

But I cannot get this to work for RadDatePicker style, what do I need to remove from the default style to not have it react to IsReadonly visually? There doesn't seem to be a VisualState for ReadOnly?

Regards,

Bayram

1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 18 Jul 2012, 12:28 PM
Hello B Demir,

To modify the ReadOnly apprearance of theTextBox in RadDatePicker,  you should change
<!-- WatermarkTextBox-->
<SolidColorBrush x:Key="ControlBackground_ReadOnly" Color="#5EC9C9C9" />
with the color of your choice.

I've attached a simple example to demonstrate the approach.

Hope this helps.


Greetings,
Maria
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DatePicker
Asked by
B
Top achievements
Rank 2
Answers by
Masha
Telerik team
Share this question
or