I use the DateTimePicker in the EditTemplate of the DataForm:
In the readonly mode of the DataForm the textbox of the DateTimePicker is disabled, BUT the DropDownButton is still enabled.
How to disable the DropDownButton?
Thanks
Björn.
<
toolkit:DataField
PropertyPath
=
"Startdate"
>
<
telerikInput:RadDateTimePicker
InputMode
=
"DatePicker"
SelectedDate
=
"{Binding Startdate, Mode=TwoWay}"
DateTimeWatermarkContent
=
""
/>
</
toolkit:DataField
>
In the readonly mode of the DataForm the textbox of the DateTimePicker is disabled, BUT the DropDownButton is still enabled.
How to disable the DropDownButton?
Thanks
Björn.
4 Answers, 1 is accepted
0
Hi Björn,
Actually this is the default behavior of RadDateTimePicker in read-only mode - the calendar is opened, but you cannot select a date. You could edit the ControlTemplate of RadDateTimePicker and add the binding to the DropDownButton IsReadOnly property. Please check here and here for more details.
All the best,
Yana
the Telerik team
Actually this is the default behavior of RadDateTimePicker in read-only mode - the calendar is opened, but you cannot select a date. You could edit the ControlTemplate of RadDateTimePicker and add the binding to the DropDownButton IsReadOnly property. Please check here and here for more details.
All the best,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Björn
Top achievements
Rank 1
answered on 09 Sep 2011, 09:33 AM
Hi Yana
Sorry for the delay. It's not so clear what you mean. I made following:
1. create in Blend a copy of the style
2. set in the xaml:
3. want to use a converter
What's the best way to bind IsEnabled to the IsReadOnly of the control?
Thanks
Björn.
Sorry for the delay. It's not so clear what you mean. I made following:
1. create in Blend a copy of the style
2. set in the xaml:
<telerik:RadDropDownButton x:Name="PART_DropDownButton" IsEnabled="{TemplateBinding IsReadOnly}"=> that works in the opposite way
3. want to use a converter
IsEnabled="{TemplateBinding IsReadOnly, Converter={StaticResource NotOperatorValueConverter}}"=> but that's not possible!
What's the best way to bind IsEnabled to the IsReadOnly of the control?
Thanks
Björn.
0
Hello Björn,
Please try it like this:
where
Hope this helps.
Regards,
Yana
the Telerik team
Please try it like this:
<
telerik:RadDropDownButton
x:Name
=
"PART_DropDownButton"
IsEnabled
=
"{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsReadOnly, Converter={StaticResource InvertedBooleanConverter}}"
...
</telerik:RadDropDownButton>
where
InvertedBooleanConverter
is defined like this:<
telerik:InvertedBooleanConverter
x:Key
=
"InvertedBooleanConverter"
/>
Hope this helps.
Regards,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Björn
Top achievements
Rank 1
answered on 15 Sep 2011, 12:49 PM
Hi Yana
I found a solution to set the RadDateTimePicker.IsEnabled=false in the DataForm, when the DataForm is in the readonly mode.
Regards and thanks for the help
Björn.
I found a solution to set the RadDateTimePicker.IsEnabled=false in the DataForm, when the DataForm is in the readonly mode.
Regards and thanks for the help
Björn.