Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ComboBox > RIA service Client side Validation using Metadata

Not answered RIA service Client side Validation using Metadata

Feed from this thread
  • Ubuntu avatar

    Posted on Jul 25, 2011 (permalink)

    Dear All,
    I have created a project using EF4, RIA Service, few telerik controls.

    I define my client-side validation using .shared files and add then using DataAnotation to the metadata class as follows:
    public static class CustomDailyValidation
    {
        public static ValidationResult ValidateSubsidiary(int id, ValidationContext validationContext)
        {
            if (id <= 0 || id == null)
            {
                return new ValidationResult("ERROR", new[] {validationContext.DisplayName});
            }
            return ValidationResult.Success;
        }
    }

    MetaData:
    [CustomValidation(typeof(CustomDailyValidation), "ValidateSubsidiary")]
    public int subsidiary_id { get; set; }

    I then populate the subsidary_id with data using QDSCV (no Problem here)

    I then add the xaml definition as follows:
    <telerik:RadComboBox x:Name="discriptorId" Margin="0,0,0,5" Grid.Row="1" Grid.Column="3" IsEnabled="{Binding IsNew}"
        ItemsSource="{Binding Path=DiscriptorsCollection,Mode=TwoWay}"
        SelectedValue="{Binding Path=CurrentDaily.discriptor, Mode=TwoWay,NotifyOnValidationError=True,ValidatesOnExceptions=True}"
        SelectedValuePath="discriptor_id"
        DisplayMemberPath="discriptor_name_1"/>

    The validation works as soon as I open the page, I don't know why, but anyway that is not the problem, the problem is that the subsidary_id combobox is displaying the error but with different message says "Input is not in correct format".

    I don't know from where is that comes? how to stop / override?

    Note:
    I have another RadDatePicker that has different validation method,
    when I set a break point in the client-side validation class the validation method for the date field is hit, but not the combo.

    Any help !!







    Reply

  • Shenbagaraj avatar

    Posted on Dec 28, 2011 (permalink)

    Im also having the same issue if any one know the answer plz help me ..  

    if i remove ValidatesOnExceptions=True then "Input is not in correct format" is not firing and validation is also not working

    i have tried ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}

    when i use silverlight combobox its working fine. but not in radcombobox....

    help me ...

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ComboBox > RIA service Client side Validation using Metadata
Related resources for "RIA service Client side Validation using Metadata"

Silverlight ComboBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]