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

[Solved] Validations in Grid Columns

1 Answer 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Suderson
Top achievements
Rank 1
Suderson asked on 20 Jan 2012, 06:46 AM
Hi,

I've StartTime and EndTime Column in my MVC Grid.

When I add items, I display the default values in the columns. I'd like to check whether the value in the StartTime Column is less than the EndTime column. I checked with the model, that I don't have any property to compare/Check the values.

Here is how I designed my model :

[DataType(DataType.DateTime)]
        public DateTime? StartTime { get; set; }

        [DataType(DataType.DateTime)]
        public DateTime? EndTime { get; set; }

Any help would be appreciated much !!

1 Answer, 1 is accepted

Sort by
0
Sreyas
Top achievements
Rank 1
answered on 30 May 2012, 12:37 PM
[GreaterThan("StartTime ")]
[DataType(DataType.DateTime)]
        public DateTime? EndTime { get; set; }



Sreyas MN
Tags
Grid
Asked by
Suderson
Top achievements
Rank 1
Answers by
Sreyas
Top achievements
Rank 1
Share this question
or