Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top