Hello,
We can add the button to your form. Double click on your button,
1. If you have solution (.sln) for this form then you have click on ‘Edit Form code' button in Button Properties to go formcode.cs file.
2. If you do not have solution file then you have to follow these below steps,
a. Tools -> Form Options -> Programming.
b. Select ‘Jscript' in ‘Form template code language' dropdown.
c. Click on ‘OK' button.
3. Then again follow the above 1st step to write the code.
You will get ‘Onclick' event for your button and copy the below code into that event to get the sorting order for dropdown values,
C#:
XPathNavigator navigator = this.MainDataSource.CreateNavigator();
XPathNodeIterator repeatingNodes = navigator.SelectChildren("XPath of your field", "Namespace of your form");
ArrayList sortValues = new ArrayList();
foreach(XMLNode repeatingNode in repeatingNodes)
{
sortValues.Add(repeatingNode.xml);
}
sortValues.Sort();
BLOCKED SCRIPT
var thisDOM = window.external.Window.XDocument;
var repeatingNodes = thisDOM .selectNodes("XPath of your field");
var sortValues = new Array();
foreach(var repeatingNode in repeatingNodes)
{
sortValues.Add(repeatingNode.xml);
}
sortValues.Sort("SortFunctionName");