Recent

Author Topic: DBGrid field restriction ('dd.mm.yyyy')  (Read 2333 times)

IndianaJones

  • Hero Member
  • *****
  • Posts: 509
DBGrid field restriction ('dd.mm.yyyy')
« on: December 25, 2012, 07:14:00 pm »

Hi all,
I want to restrict the dbgrid cell input as 'dd.mm.yyyy' format. Can someone give a clue? or a simple code.
Thanks.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: DBGrid field restriction ('dd.mm.yyyy')
« Reply #1 on: December 26, 2012, 12:35:34 am »
If you create a persistent TDateField for the dataset your datasource is pointing to, you can set the field's EditMask property to something like 00.00.0000;1;_ (or whatever is appropriate for your case). Obviously your database has to accept this format for date entry, otherwise you'll get an exception.

 

TinyPortal © 2005-2018