Validation in enterprise Library

2 posts, 0 answers
  1. Arif
    Arif avatar
    13 posts
    Member since:
    Dec 2006

    Posted 04 Oct 2010 Link to this post

     

     

     

    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.

     

  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 06 Oct 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top