I am trying to sort a form's control collection based on where it is placed on the form.
I am first getting my form control programmatically like this:
var form = FormsManager.GetManager().GetFormByName("sf_testform");
When getting the control though, they are returned in a random order it seems. How do I sort them by their ordinal positioning on the page?
var controls = form.Controls.OrderBy(c => c.???)
I tried using the "PositionInSection" in MetaField, but it is blank unless explicitly defined:
Do the form controls have an ordinal position that I can use to sort?
var formControls = form.Controls.OrderBy(c => c.Properties.GetMetaValue(
var metaField = property.FirstOrDefault(p => p.Name ==
value = String.Empty;
//GET STORED META VALUE
var childProperty = metaField.ChildProperties.FirstOrDefault(c => c.Name == key);
value = childProperty.Value;