Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a browser based infopath form with dropdown list and the list is populated with values from a SharePoint List(using Data Connections) that contains two columns title and Body(Rich text field allows user to format text). I have set the dropdowns displayname to use Title and the Value column is set to use "Body" column.

When the form is rendered on the browser user can select an value from the dropdown list and click on the "Add ... condition" button and the formatted text from dropdownlist value is assigned to rich text box(see figure 2). I'm using VSTA code(on button click i have some code) to assign the value selected from the dropdown list to the Rich Text Field.

The problem is after the button click event the dropdown list is populated with the XHTML tag in the drop down list. If I select another item and click on the button then the Dropdownlist is refreshed and it doesnt show the item with HTML tags... Its bit weird...

Any suggestions... welcome.

Figure 1: enter image description here Figure 2: enter image description here

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

Found the problem

When you select a item from dropdownlist it is stored in the XML file and on postback you will be able to read the content of XMLNode and assign it to RTF conrol but since the value is not cleared from XMLNode it is displayed in the Dropdownlist.

So after assigning the value to RTF control I cleared the XMLNode value.. something like this

MainDataSource.SelectSingleNode("/myfields:dropdownlist1/.....").SetValue("")

After the postback the XML content will not appear in the dropdownlist...

Hope this helps someone.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.