Con risposta Programatically clear datepicker?

  • sabato 18 agosto 2012 07:37
     
     

    Frankly, am embarrassed that I can't figure out something so basic. I want to clear selected dates in two Lightswitch datepicker controls. I can set dates (me.datepickername = date.today, etc.) but can't get the darn thing to clear. What's the code (vb or c#) to make this happen? Thanks.

Tutte le risposte

  • sabato 18 agosto 2012 08:00
     
     

    if they are allowed to be null then me.datepickername = null

    If they are not allowed to be null then you are stuck


    If you found this post helpful, please mark it as helpful. If by some chance I answered the question, please mark the question as answered. That way you will help more people like me :)

  • sabato 18 agosto 2012 22:29
     
     

    Thanks, Ot1s. I had previously tried that but Null constant isn't allowed by vb code editor and Dbnull.value generates error: can't be converted to type Date.

  • domenica 19 agosto 2012 06:52
     
     Con risposta

    Me.DateProperty = Nothing

    Just make sure that the date property isn't required otherwise lightswitch will convert Nothing to "1/1/001" date.


    "HARD WORK BEATS TALENT WHEN TALENT DOESN'T WORK HARD"

    HAROLD GLENN MINERVA
    http://hgminerva.wordpress.com

    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”. This will help other users to find their answer quickly.

    • Proposto come risposta Babloo1436 domenica 19 agosto 2012 09:17
    • Contrassegnato come risposta JBeit domenica 19 agosto 2012 22:54
    •  
  • domenica 19 agosto 2012 22:53
     
     

    Me.DateProperty = Nothing

    Just make sure that the date property isn't required otherwise lightswitch will convert Nothing to "1/1/001" date.


    Solved. Thank you very much, Harold!