date format entry in datagrid

Hi,
I have a datagrid control that displays date inforamtion. I want the user to enter dates in ###### fashion. However, I have set datagrid column style format to ##/##/## which works for displaying dates already entered but does not allow the user the enter ######, they must enter ##/##/##.
If this has to be done, is there anyway to automatically put in the / date divider
thanks


Answer this question

date format entry in datagrid

  • LionelG

    Hi Ken,
    The format fn. enables me (using a combination of caps & lower case!) to display the dates in 00/00/00 format, however still when the user enters 000000 it does not save the date, they must manually put in the dividers. 
    Do I need to ask a masked edit control to the datagrid  I am unsure about this as I think the masked edit control is not very easy to work - especially as I want to be able to restrict the user from entering dates in the past.
    thanks.

  • Twil1ght

    Definitely can put in the dividers for them. Check out the Format and Parse events of the Binding object. I haven't done this in a data grid, but it definitely can be done.
  • date format entry in datagrid