Monday 8 October 2012

Write html (like Hyper Link) in RichText Box in Infopath 2010 for Sharepoint list data.

1. Take (field1) one Richtext box and  (txturl) one text box fields.
2. On Form Load, Bind data connection toTextBox Controls.
3. Go to Infopath 2010 Form load event, write the code.

public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
XPathNavigator attachmentNav = MainDataSource.CreateNavigator();
string url = attachmentNav.SelectSingleNode("/my:myFields/my:txturl", NamespaceManager).Value;
attachmentNav.SelectSingleNode("/my:myFields/my:field1", NamespaceManager).InnerXml = "<p xmlns='http://www.w3.org/1999/xhtml'>" + url + "</p>";
}

In ulr=" Welcome to the sharepoint 2010 with  <a  href='http:/www.google.com'>Infopath 2010</a>

Example: Welcome to the sharepoint 2010 with Infopath 2010


No comments:

Post a Comment