10 Answers, 1 is accepted
There is a property that I think will do perfect for you. Just set isReadOnly=true. Let me know if this is not fulfilling your needs
Regards,
Boyan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks for the reply, but IsReadOnly is not exactly what I want to do, IsReadOnly disables the input through calendar too; I just want to restrict the input from textbox and not from calendar.
Something similar is implemented in one of your samples but I am not able to check it as whenever I try to open any file in your samples, VS crashes.
http://demos.telerik.com/wpf/?Chart/Integration/DeliverySchedule
Currently we do not support such a feature, the closest one is the isReadOnly property but when set to false, you can't choose date with the mouse. To achieve what you want, you can delete the 293th line in this file
WPF\Input\Themes\DatePicker\Telerik\DatePicker.Styles.xaml :
IsReadOnly="{TemplateBinding IsReadOnly}"
Then, just set isReadonly to the Datepicker. Thus, with this custom .dll, you can disable the ReadOnly for the Calendar so that ReadOnly is only the textbox and the picked date will show appropriately in the textbox, however, you won't be able to write in it.
I attached the modified Telerik.Windows.Controls.Input.dll.
If you have further problems or this workaround don't fulfill your needs, feel free to write again.
Greetings,
Boyan
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
<
telerik:RadDateTimePicker
ID
=
"dtpStop"
Runat
=
"server"
>
<
DateInput
DisplayDateFormat
=
"d MMM yyyy h:mm tt"
ReadOnly
=
"true"
></
DateInput
>
</
telerik:RadDateTimePicker
>
private void filterDate_KeyDown(object sender, KeyEventArgs e)
{
e.Handled = true;
}
Hope this helps someone
ReadOnly="true"
the above attribute resolved the problem...
check the sample below for more explaination :
<telerik:RadDatePicker ID="radBirthDate" runat="server" Culture="English (United States)"
Font-Size="14px" Font-Names="Times New Roman" MinDate="1901-01-01" Skin="Office2007"
EnableTyping="False">
<DateInput DateFormat="dd/MM/yyyy" Font-Size="small" ReadOnly="true" runat="server">
</DateInput>
<Calendar Skin="Office2007" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
ViewSelectorText="x" runat="server">
</Calendar>
</telerik:RadDatePicker>
I found an easy form that resolved the problem:
Only you need agregate the propertie EnableTyping="false" and then the user canĀ“t writte.
<telerik:RadDatePicker runat="server" ID="rdpExpirationDate" AutoPostBack="false" Width="100%" EnableTyping="False" />