0 Replies - 8133 Views - Last Post: 28 November 2011 - 12:42 PM

#1 MarmiteX1  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 159
  • Joined: 17-October 09

DateTimePicker control validation issue

Posted 28 November 2011 - 12:42 PM

Hi,

I was hoping you could help?

I am currently using DateTimePicker ui control to allow the user to pick a date and populate a label control with the date.

I also allow the user to paste a date into the control.

What i am trying to do is prevent the user from entering garbage data like "14/02/YYYY". As you can see thats not a valid date since YYYY is not a valid year.

I would like to prevent the user from entering a date like this. One way i can think of is use CustomValidation. How would i go about capturing the invalid data?

Currently I have a public property which i bind the control to called CreationDate

[Required]
public DateTime CreationDate
{
  get;
  set;
}



In the Xaml i am using a Dataform which is within a Grid
<df:DataField label = "CreationDateLabel">
<Controls:DatePicker SelectedDate={Binding CustomerRecord.CreationDate, Mode=TwoWay}/>
</df:DataField>



Thanks in advance,

Is This A Good Question/Topic? 0
  • +

Page 1 of 1