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

CustomValidation and ErrorMessage

1 Answer 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Louis Bouchard
Top achievements
Rank 1
Louis Bouchard asked on 25 May 2010, 10:28 PM
Hello,

In my metadata.cs file I use a CustomValidation like this :
...
[CustomValidation(typeof(MesValidations), "DescriptionActionPreventiveUneValeur")]
public string DescriptionActionPreventive_en { get; set; }

...

But when my ErrorMessage is displayed, it's in tooltip not within a red rectangle (see attachement). 

MesValidations.shared.cs :

public static System.ComponentModel.DataAnnotations.ValidationResult DescriptionActionPreventiveUneValeur(Object DescriptionActionPreventive, ValidationContext context)
{
    if (((String)DescriptionActionPreventive) == "oui")
    {
        return System.ComponentModel.DataAnnotations.ValidationResult.Success;
    }
    else
    {
        return new System.ComponentModel.DataAnnotations.ValidationResult("I'm not in the red rectangle error message!");
    }
}


I want know if it's related with my code or someting wrong with my RadGridView.

Thank you

1 Answer, 1 is accepted

Sort by
0
Louis Bouchard
Top achievements
Rank 1
answered on 27 May 2010, 10:29 PM
It's working now.  Thank you.
Tags
GridView
Asked by
Louis Bouchard
Top achievements
Rank 1
Answers by
Louis Bouchard
Top achievements
Rank 1
Share this question
or