need help with syntax for getting and setting value of InfoPath 2007 check box

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)
 
G

gerry_lowry alliston

RESOLVED ... I made a typo: License (the American spelling) should have been Licence (the British spelling).
Gerry

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top