lee Juu

lee Juu

  • NA
  • 1
  • 0

How can i use a masked textbox column in a datagridview for date

Apr 27 2006 7:00 AM

How can i use a masked textbox column in a datagridview for date
================================================================

I am working with Visual studio 2005 and c# 2005.

I have a datagridview which contains a date column and will accept value as 26-04-2006.Initially value will be 00-00-0000.When we press any key it will check value which we entered is number or not.if it is number then it will check for other conditions like

1 the day is greater 32 or not?
2 the month is greater than 12 or not?
3 the year is greater than 2006 or not?..like that.

we have to find in keypress event and cancel each character if it fails.

when we do backspace each value must changed to zeros..

I used masked textbox in datgridview for this but i am facing so many issues for that..

When we editing it will not work properly..the values are getting overlapped with the grid contents and all..i created the masked textbox dynamically in editcontrolshowing event..

if anybody did the same pls help me it is very urgent..

If you have any other solution that are also welcome

thanks in advance,


lee ju

Answers (1)