0

My client wants to have a datetimepicker in his datagridview.

I tried example from MSDN(CalendarColumn) but it doesnt fit some of my client's needs. I also tried example where you replace textbox with datetimepicker but it has same problems.

So i dumped idea of datetimepicker and started working with just a textboxfield Control is almost done but some details are missing, can you help me with solving them?

  1. Can i have multiple input fields inside one cell like datetimepicker does?

  2. Can i enter edit mode on textboxfield and go straight to it? currently it first selects all data that are in the cell. can i skip it and go straight to editing where mouse cursor was?

  3. Can i have some kind of maskedtextbox functionality? so that my client enter only numbers, and for him it will show with separators. (i solved it via text changed event but maybe there is a better way)

    Thank you for your time!

Community
  • 1
  • 1
  • You can follow the idea of that `CalendarColumn` example and create your own `MaskedTextBoxColumn`. – Reza Aghaei Sep 14 '16 at 16:54
  • Also there are some `MaskedTextBox` columns around. For example [this one](http://www.codeproject.com/Articles/26005/DataGridViewColumn-Hosting-MaskedTextBox). They are good start points, but be aware of some [problems](http://stackoverflow.com/questions/38876167/create-new-row-in-datagridview-masked-textbox). – Reza Aghaei Sep 14 '16 at 16:56
  • Just an FYI - this is a multi ? post and typically SO only allows one question per post. – Bob Goblin Sep 14 '16 at 16:57
  • Thanks @RezaAghaei! MaskedTextBox column allowed me to simplify my code by a lot. – user3342686 Sep 15 '16 at 20:23

0 Answers0