Hello,
I think I'm making this harder than it should be. I have a survey form with 5 fields that I'm summarizing the values 1-5 chosen in a long list of radio buttons. No problem reading the values of the radio buttons and populating the fields. I've got the code in a view switched event and have multiple views so everytime it switches views it appends the values to the list. I'm getting multiple values in my list. All I want to do is clear the values in the Summary fields before I populate them. Darned if I can figure out how to do it. I think it must be easy but nothing I do seems to work.
(as an added bonus if anyone can tell me how to put in line breaks I'd appreciate it because the /r/n thing doesn't work)
Thanks,Brad
Here's my code I use to populate the summary fields:
XPathNavigator domNav = MainDataSource.CreateNavigator();
XPathNodeIterator rows = domNav.Select("/my:myFields/my:Skills/my:Skill", NamespaceManager);XPathNavigator developing = domNav.SelectSingleNode("/my:myFields/my:RequiredSkills/my:SkillsDeveloping", this.NamespaceManager);
XPathNavigator familiarfirst = domNav.SelectSingleNode("/my:myFields/my:RequiredSkills/my:SkillsFamiliar", this.NamespaceManager);XPathNavigator proficient = domNav.SelectSingleNode("/my:myFields/my:RequiredSkills/my:SkillsProficient", this.NamespaceManager);
XPathNavigator advanced = domNav.SelectSingleNode("/my:myFields/my:RequiredSkills/my:SkillsAdvanced", this.NamespaceManager);XPathNavigator expert = domNav.SelectSingleNode("/my:myFields/my:RequiredSkills/my:SkillsExpert", this.NamespaceManager);
// XPathNavigator na = domNav.SelectSingleNode("/my:myFields/my:RequiredSkills/my:SkillsNotApplicable", this.NamespaceManager);while (rows.MoveNext())
{
string skilllevel = rows.Current.SelectSingleNode( "my:Skill_Level", NamespaceManager).Value;
string skillcategory = rows.Current.SelectSingleNode("my:Skill_Category", NamespaceManager).Value;string skillname = rows.Current.SelectSingleNode("my:Skill_Name", NamespaceManager).Value;
string skillvalue = skillcategory + ": " + skillname;switch (skilllevel)
{
case "1":
familiarfirst.AppendChild(skillvalue +=
"; \r\n");break;
case "2":developing.AppendChild(skillvalue += "; \r\n");
break;case "3":
proficient.AppendChild(skillvalue +=
"; \r\n");break;
case "4":advanced.AppendChild(skillvalue += "; \r\n");
break;case "5":
expert.AppendChild(skillvalue +=
"; \r\n");break;
default:
// na.AppendChild(skillvalue += "; ");break;
}
}