Microsoft Office Tutorials and References
In Depth Information
Writing event validation for an expense report form
XPathNavigator xField = xNavigator.SelectSingleNode("/my:
expenseReport/my:manager/my:managerName",
this.NamespaceManager);
StrManagerName = xField.InnerXml;
//Create a Navigator object to access the main DOM
XPathNavigator xDoc = this.MainDataSource.CreateNavigator();
//Create a Navigator object for the field that you want to set
XPathNavigator xData = xDoc.SelectSingleNode("/my:
expenseReport/my:msgManagerChange", this.NamespaceManager);
// Set old and newly changed manager names
xData.SetValue("Old Name: " + e.OldValue.ToString() + " & New
Name: " + e.NewValue.ToString());
}
}
public void Button_Submit_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator xNavigator = this.MainDataSource.
CreateNavigator();
// Primary value to be validated
XPathNavigator xMgrValue = xNavigator.SelectSingleNode("/my:
expenseReport/my:manager/my:managerName",
this.NamespaceManager);
XPathNavigator xMgrEmailValue = xNavigator.SelectSingleNode("/my:
expenseReport/my:manager/my:managerEmailAddress",
this.NamespaceManager);
if (xMgrValue.Value.ToString() == string.Empty ||
xMgrEmailValue.Value.ToString() == string.Empty)
{
MessageBox.Show("Please enter manager information");
}
}
}
 
Search JabSto ::




Custom Search