Populate Date Picker from code - InfoPath Dev
in

InfoPath Dev

Populate Date Picker from code

Last post 02-04-2009 11:24 AM by uffan. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-04-2009 08:42 AM

    • uffan
    • Not Ranked
      Male
    • Joined on 10-30-2008
    • Atlanta, GA, USA
    • Posts 8

    Populate Date Picker from code

    Hey, I am trying to populate a date picker from the code behind but when trying the code below I receive the following error: System.InvalidOperationException Schema validation found non-data type errors.

    Dim depart_date as String = "2009-02-04"

    Dim nav As XPathNavigator = MainDataSource.CreateNavigator()

    nav.SelectSingleNode("//my:d_date", NamespaceManager).SetValue(depart_date)

    I have tried using CDate(depart_date) as well as check the date picker properties to make sure the format was the same but neither idea worked.

    Any help would be greatly appreciated!

  • 02-04-2009 09:48 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Populate Date Picker from code

    Hello,

    Check out this link, 

    http://www.infopathdev.com/forums/p/9400/33279.aspx#33279

  • 02-04-2009 10:57 AM In reply to

    Re: Populate Date Picker from code

    I think you are running into the xsi:nil attribute. Check out this blog post from the InfoPath team.....

    Hilary Stoupa

  • 02-04-2009 11:24 AM In reply to

    • uffan
    • Not Ranked
      Male
    • Joined on 10-30-2008
    • Atlanta, GA, USA
    • Posts 8

    Re: Populate Date Picker from code

     Thank you both for the help, I was able to use the solution suggested in Shiva's post.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.