G
gerry:lowry:abcs
need help with syntax for getting and setting value of InfoPath 2007 check box
Please note: I am using InfoPath 2007 on the desktop, not the web form version.
public void startLesson_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator myNavigator = this.MainDataSource.CreateNavigator();
XPathNavigator myGclassLicense = this.MainDataSource.CreateNavigator()
.SelectSingleNode("/my:lessonData/my:lessonFields/my:GclassLicense",
NamespaceManager);
while (true)
{
if (myGclassLicense != null) break;
MessageBox.Show("lesson can not precede; driver is not licensed.");
return;
}
The first time through to above code, after the form has been loaded, the check box is unchecked.
The code appears to work because, myGclassLicense is null.
However, when I then click the check box, even though visually it is checked, myGclassLicense is still null.
I assumed that somehow I am not getting the correct value.
What am I missing here?
Please advise.
Also, what is the c# syntax for setting the value?
Thank you.
Regards,
Gerry (Lowry)
Please note: I am using InfoPath 2007 on the desktop, not the web form version.
public void startLesson_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator myNavigator = this.MainDataSource.CreateNavigator();
XPathNavigator myGclassLicense = this.MainDataSource.CreateNavigator()
.SelectSingleNode("/my:lessonData/my:lessonFields/my:GclassLicense",
NamespaceManager);
while (true)
{
if (myGclassLicense != null) break;
MessageBox.Show("lesson can not precede; driver is not licensed.");
return;
}
The first time through to above code, after the form has been loaded, the check box is unchecked.
The code appears to work because, myGclassLicense is null.
However, when I then click the check box, even though visually it is checked, myGclassLicense is still null.
I assumed that somehow I am not getting the correct value.
What am I missing here?
Please advise.
Also, what is the c# syntax for setting the value?
Thank you.
Regards,
Gerry (Lowry)