DatePicker - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

DatePicker

Last post 03-19-2009 06:00 AM by karthik. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-19-2009 03:01 AM

    • karthik
    • Not Ranked
      Male
    • Joined on 03-18-2009
    • India
    • Posts 23

    DatePicker

    hi,     

          i am karthik.i have a doubt in infopath i am used date picker in infopath form. when i am selecting the date i want perform some opretion.i done this process but when i deployed in sharepoint its notworking.i am wating for ur reply very soon.

    Thanks

    karthik

  • 03-19-2009 04:14 AM In reply to

    • Elena
    • Not Ranked
      Female
    • Joined on 05-15-2008
    • Russia
    • Posts 14

    Hi, Karthik!

    And which browser do you use?

    Although you can use date pickers in a browser-compatible form template, the calendar icon and pop-up calendar appear only in supported versions of Internet Explorer. In other browsers, the date picker appears as a text box, but the date formatting options are still supported.

    (Please, check this link http://office.microsoft.com/en-us/infopath/HA102040851033.aspx)

    Elena

  • 03-19-2009 06:00 AM In reply to

    • karthik
    • Not Ranked
      Male
    • Joined on 03-18-2009
    • India
    • Posts 23

    thank you for your response Elena

    my browser verson  IE.07

    But thats not my problem. all calendar icon and pop-up calendar appear perfect.my issue is when i am selecting the date i want to perform some functionality.using Onchangeevent this is working fine in infopath but after deploye the template that particular functionality not working.below code not working in sharepoint.

    (i.e)

    public void ToDate_Changed(object sender, XmlEventArgs e)
            {
                try
                {             TimeSpan dateDiff = toDate.Date.Subtract(frDate.Date);
                    int noOfRows = dateDiff.Days; ;

                    XPathNodeIterator xiNewContacts = MainDataSource.CreateNavigator().Select("/my:myFields/my:group1/my:group2", NamespaceManager);
                    if (xiNewContacts.Count > 1)
                    {
                        XPathNavigator first = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1/my:group2" + "[2]", NamespaceManager);
                        XPathNavigator last = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1/my:group2" + "[position() = last()]", NamespaceManager);
                        first.DeleteRange(last);

                    }

                    XPathNavigator nav = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1/my:group2", NamespaceManager);

                    for (double i = 0; i <= noOfRows; i++)
                    {
                        nav = nav.Clone();
                        DateTime dt = frDate.Date.AddDays(i);
                        nav.SelectSingleNode("/my:myFields/my:group1/my:group2/my:InfoDetDate", NamespaceManager).SetValue(dt.ToString("dd/MM/yyyy"));
                        //nav.SelectSingleNode("/my:myFields/my:group1/my:group2/my:txtDateUS", NamespaceManager).SetValue(dtpFromDt.Date.AddDays(i).ToString("yyyy-MM-dd"));
                        nav.SelectSingleNode("/my:myFields/my:group1/my:group2/my:Fullday", NamespaceManager).SetValue("1");
                        nav.SelectSingleNode("/my:myFields/my:group1/my:group2/my:Forenoon", NamespaceManager).SetValue("0");
                        nav.SelectSingleNode("/my:myFields/my:group1/my:group2/my:Afternoon", NamespaceManager).SetValue("0");

                        XPathNavigator nav1 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1", NamespaceManager);
                        nav1.AppendChild(nav);
                    }

                     }
                catch (Exception ex)
                {
                    MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:txtDateError", NamespaceManager).SetValue(ex.ToString());
                }
            }

    thanks

    karthik

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