Microsoft Office Tutorials and References
In Depth Information
Xml events
Merge event
In InfoPath 2003, you needed to write your own .xsl transformation code to
perform a merge. In InfoPath 2007, merging forms can be done using a built-in
event handler.
FormEvents_Merge(object sender, MergeEventArgs e)
Here is an example to show how the InfoPath forms can be merged:
public void FormEvents_Merge(object sender, MergeEventArgs e)
{
string strFromPath = @"C:\InfoPathForm\Form1.xml";
XmlDocument InfoPathXML = new XmlDocument();
// The InfoPath Form template must be Fully Trusted.
InfoPathXML.Load(strFromPath);
XPathNavigator xNavigate = InfoPathXML.CreateNavigator();
// Merge the root node to the current form.
this.MergeForm(xNavigate);
}
A Merge event can be cancelled by using the CancelableArgs property of the
MergeEventArgs class and setting the Cancel property to true .
Xml events
InfoPath 2007 is a powerful data-driven platform. XML events are otherwise called
data validation events in InfoPath. The changed event, changing event, and the
validating event are the events used for form validation purposes, as explained
in the following table:
Name
Description
fieldname_Changed
Changed event will be fired after the changes to a form's
essential XML document have been accepted and the
Validating event has occurred; the Changed event is
bound using the XmlChangedEventHandler delegate.
fieldname_Changing
Changing event will be fired after changes to a form's
essential XML document have been made, but before the
changes have been accepted; the Changing event is bound
using the XmlChangingEventHandler delegate
fieldname_Validating
Validating event is fired after changes to a form's
essential XML document have been accepted, but before
the Changed event has occurred; the Validating event is
bound using the XmlValidatingEventHandler delegate
 
Search JabSto ::




Custom Search