CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    96

    [RESOLVED] Handle Nullable Date Field with DateTimePicker

    Dear All,

    Which is the best pratice to handle a Nullable Date Field with DateTimePicker control. From my previous experience i learned that we could not show Null in datetimepicker control, i used to fix this problem with IIF function. can anyone help me out to solve this problem in a better way

    Warun

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Handle Nullable Date Field with DateTimePicker

    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Sep 2006
    Posts
    96

    Re: Handle Nullable Date Field with DateTimePicker

    Thanks for your suggestion. I solved the same by setting
    DateTimePicker1.Format = Custom
    DateTimePicker1.CustomFormat = " "

    this case your DateTimePicker control shows blank in display, and whenever user select a particular date, i set the custom format to appropriate expression. pressing delete key set the customformat again as " ". so the space we can treat as Null and not space you can consider as datetime value

    Warun

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured