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

Validation in enterprise Library

1 Answer 66 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Arif
Top achievements
Rank 1
Arif asked on 04 Oct 2010, 10:26 AM

 

 

 

Hi all,
i have applied validation in a text box as follows. note i m using enterprise library for validation purpose:

<
TextBox Grid.Row="3" Grid.Column="1" TabIndex="2" Margin="5" MinHeight="40" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" >

 

 

 

 

<Binding Path="Vehicle.Comments" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True" Mode="TwoWay" >

 

 

 

 

<Binding.ValidationRules>

 

 

 

 

<y:ValidatorRule SourcePropertyName="Comments" SourceType="{x:Type e:tblVehicle}"/>

 

 

 

 

</Binding.ValidationRules>

 

 

 

 

</Binding>

 

 

 

 

</TextBox>

now i want to apply it at RadDatePicker:

 

 

 

 

<telerik:RadDatePicker TabIndex="8" ToolTip="Enter due date ..." Name="dtpDueDate" Height="25"

 

 

 

Background="Transparent" BorderBrush="{DynamicResource brushWatermarkBorder}" >

 

 

 

 

<telerik:RadDatePicker.SelectedDate>

 

 

 

 

 

 

 

 

 

</telerik:RadDatePicker.SelectedDate>

 

 

 

 

 

 

 

 

 

 

 

 

</telerik:RadDatePicker>
it give me nothing under .selectedDate property.

how can i apply the validation rule in a pattern as applied at textbox in the datepicker?

Thanks.

 

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 06 Oct 2010, 09:46 AM
Hello Arif,

You can use the same approach as the TextBox text property validation. Just note that the return type must be of DateTime, the same as the SelectedDate type property. 

Regards,
Kaloyan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DatePicker
Asked by
Arif
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or