Setting Rich Text XML - InfoPath Dev
in

InfoPath Dev

Setting Rich Text XML

Last post 02-22-2007 09:38 AM by Anonymous. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 10-24-2006 08:09 AM

    Setting Rich Text XML

    Having more problems with Rich Text.

    I can get the xml and therefore get the formatted text from one text box. I am trying to set another rich text box through code:

    IXMLDOMNode nodeMainText = thisXDocument.DOM.selectSingleNode("my:myFields/my:txtMainText");


    nodeMainText.xml = thisXDocument.DOM.selectSingleNode("/my:myFields/my:txtSummary").xml;


    I am getting the following error:

    Property or indexer 'Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMNode.xml' cannot be assigned to -- it is read only

    any help appreciated
  • 10-24-2006 11:00 AM In reply to

    Hello Travis,
    "xml" property is a readonly property of IXMLDomNode.
    Here is the code that lets you copy the rich text data

    foreach(IXMLDOMNode listNode in sourceRichTextNode.childNodes)
    {
    destRichTecxtNode.appendChild(listNode.cloneNode(true));
    }
  • 10-24-2006 11:11 AM In reply to

    Thanks for that.

    I'm basically playing about with the DOM at the moment. However, the objective is to display stored formatted text and display in the rich text boxes. This will be provided from a web service.

    As i cannot bind rich text to a SQLServer data type. I was thinking of storing the rich text data as an xml string and get the formatted data as string from webservice and update control with this.

    Am i on the correct track here?
  • 10-24-2006 11:26 AM In reply to

    As I said before you cannot set "xml" value directly.
    So what you need to do here is get the xml string from the webservice and prepare a node out of that, get all child nodes of that new node and assign them to the richtext field.
  • 10-24-2006 11:44 AM In reply to

    Thanks for the quick response. I'll give it a go. (-:
  • 02-22-2007 09:38 AM In reply to

    I need to make something like that, I have a web service that return a xml string and with this xml I want to "populate" a rich text box.
    But I have no idea how to create a node with my xml string !!

    Can someone help me ?
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.