delete entrys from drop down - InfoPath Dev
in

InfoPath Dev

delete entrys from drop down

Last post 05-06-2010 12:46 AM by gristy. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-06-2010 12:46 AM

    • gristy
    • Not Ranked
    • Joined on 05-06-2010
    • Posts 5

    delete entrys from drop down

    Hi Guys,

    i have the following code that populates a drop down, it works fine, but id like to refresh entrys in the drop down via a button, however i get mixed results when re-reunning it so id like to add to this code to clear all existing entrys in the drop down first. Could someone please help.

     SPList sm = web.Lists["Scope Management"];

    SPListItemCollection smi = sm.Items;

    XPathNavigator xPathNav = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:SectionA/my:ProjectProposal/my:projectproposals", NamespaceManager);

     

    xPathNav.SelectSingleNode(
    "/my:myFields/my:SectionA/my:ProjectProposal/my:ddProjectProposal", NamespaceManager).SetValue("");

    XPathNavigator Loc = xPathNav.SelectSingleNode("/my:myFields/my:SectionA/my:ProjectProposal/my:projectproposals", this.NamespaceManager);

    Loc.SetValue("");XPathNavigator templateNode = Loc.Clone();

     

    foreach (SPListItem i in smi)

    {

    String Name = i.Name;

    XPathNavigator newNode = templateNode.Clone();

    newNode.SetValue(Name);

    Loc.InsertAfter(newNode);

    }

    Loc.DeleteSelf();

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