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();