Create XForm fields programmatically


Hi, did somebody had experience with creating fields for xform dynamically?

The user can add polls through the view (not inside edit) so I need to add this to the XForm fields programatically.

This is a part of the solution: 

XFormData data = form.CreateFormData();
data.PageGuid = pageData.PageGuid;
data.SetValue("MyCustomFieldName", "MyValueAsString");
data.ChannelOptions = ChannelOptions.Database;
But I need to add select with options to the XForm.Document somehow. 
Does somebody have a solution for this? I was trying to find the way they do it in UI through dotPeek but haven't succedeed.
Thanks in advance :)
Dec 10, 2014 16:19

This link may give you some idea.


Edited, Dec 10, 2014 16:43
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.