I've got a problem.
How can I fill down a drop-down box with data from code.
1.I've got a drop-down box in a repeating table. How can I programmatically
fill down this box with data received fromm SQL so the user in could change
value manually. This data is subtracted from the SQL datasource according to
the value from another drop-down box.
This is the test code sample how can I add data. I neen an idea what tools I
have to use :
XPath of my box is :
"/my:myFields/my:table/my:group2/my:name"
root = _senderObject.MainDataSource.CreateNavigator();
try
{
root.MoveToChild("myFields", root.NamespaceURI);
root.MoveToChild("table", root.NamespaceURI);
root.MoveToChild("group2", root.NamespaceURI);
root.MoveToChild("name", root.NamespaceURI);
XmlWriter writer = root.AppendChild();
writer.WriteStartElement("my", "name",
"http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-10-12T06:46:39");
writer.WriteString("New data");
writer.WriteEndElement();
writer.Close(); //Here I receive a mistake.
}
But this doesn't work.
2. How can I extract xml schema from xsn. file?
Thank you!!!
S.Y.M. Wong-A-Ton - 04 Apr 2007 09:30 GMT
1. There is a CreateElement method you can use. Try using that with
AppendChild to add elements to the group node of the data source used for the
drop-down.
2. I'm not sure I understand your question. You can extract the form files
via the File menu in InfoPath. Those files will contain the XML schema
definition file for your form.
---
S.Y.M. Wong-A-Ton
> I've got a problem.
> How can I fill down a drop-down box with data from code.
[quoted text clipped - 31 lines]
>
> Thank you!!!