Related Topics
FormControl Class
This object represents a single form field.
Form array controls are 1-based, so they always start with row number 1 (not 0).
Properties
PROPERTY NAME |
DATA TYPE |
DESCRIPTION |
---|---|---|
Name |
String |
The name of the form field |
FCID |
String |
The ID of this form field |
Text |
String |
The string/text representation of the form field’s value |
Value |
Data type of Form Field |
The raw value of a form field |
Number |
Decimal |
The numerical representation of the form field’s value |
DateTime |
DateTime |
The DateTime object that represents the form field’s value |
DisplayString |
String |
This property can be used to get (but not set) the form control’s display string. |
Checked |
Boolean |
This represents whether the control is checked (true/false, for Check Box controls only) |
Expanded |
Boolean |
This represents whether the control is expanded or collapsed (true/false, for Sections only) |
ClientID |
String |
The client-side ID which can be used by JavaScript to access the control |
IsInArray |
Boolean |
True if the control exists within an array; false otherwise |
DDHasItems |
Boolean |
This represents if the DropDown control has items in it (true/false, for DropDown controls only) |
ColumnChildren |
List Object |
A list of controls in an array column (for Array column controls only) |
ArrayFCID |
String |
If this control is in an array, the FCID of the array control |
ArrayNum |
Integer |
If this control is in an array, the row number |
ArrayName |
String |
If this control is in an array, the name of the array |
ArrayControl |
Form Control Object |
If this control is in an array, the FormControl of the array |
ArrayColumns |
List Object |
If this control is an actual array, the List<FormControl> of children |
Display.EventField |
Boolean |
Sets if the control is an event field (eYNU) |
Display.DataType |
Code Enum |
Sets the Data Type of the control (FormEnums.eDataType enum) |
Display.FriendlyName |
String |
Sets the friendly name of the control |
Display.Visible |
Boolean |
Gets or sets if the control is visible (eYNU) |
Display.Enabled |
Boolean |
Gets or sets if the control is enabled (eYNU) |
Display.Required |
Boolean |
Gets or sets if the control is required (eYNU) |
Display.Style |
String |
Gets or sets the style of the control, using CSS style directives, e.g.:
|
Display.ToolTip |
String |
Gets or sets the tooltip for this control |
Display.Control |
Form Control Object |
Gets the actual ASP.NET Control of this Form control |
Examples
// Sets the control “MyTextBox” as an event field
CurrentForm.FormControl("MyTextBox").Display.EventField = eYNU.Yes;
// Sets the control “MyTextBox” Friendly Name
CurrentForm.FormControl("MyTextBox").Display.FriendlyName =
"Your current address";
Methods


This API adds a row to an Array
Parameters
At: (Optional) The position to insert the new row. Without this parameter, the API will add the new row to the end of the Array.
Returns
Integer: The number of rows in the array after the Add
Examples
// This will add a row to the beginning of "Array1"
CurrentForm.FormControl("Array1").AddRow(1);
// This will add a row to the end of "Array1"
CurrentForm.FormControl("Array1").AddRow();


This API adds a row to a comment log
Parameters
CodeComment: (Optional) The CodeComment for the CommentLog. Not all Comment Log controls use a CodeComment. Specify null for these controls.
Date: The DateTime to be associated with the new comment.
UID: The ID of the user to be associated with the new comment.
Comment: The comment to add.
Returns
Integer: The number of rows in the Comment Log after the Add.
Examples
// This will add a new comment for the current user
CurrentForm.FormControl("ComLog1").AddRowToCommentLog(null,
DateTime.Now, CurrentUser.UID, "This is my new comment");


This API adds an item or list of items to a DropDown control. This is an overloaded method with the following possible declarations:
public void AddToDropDown(IEnumerable<DropDownValue> DDList)
public void AddToDropDown(DropDownValue DDV, params DropDownValue[] DDVs)
public void AddToDropDown(IEnumerable<string> ListText,
IEnumerable<string> ListValues)
public void AddToDropDown(IEnumerable<string> Values)
public void AddToDropDown(string pValue, params string[] Values)
Parameters
DDList: DropDownValue objects or strings to add to the dropdown.
Item1, Item2, Item3, etc.: DropDown items to add to the DropDown control.
ListText: List of Text (name) values (use with ValuesList)
ListValues: List of Values to add to the dropdown (use with ListText)
Values: iEnumerable or Params object containing string values
pValue: String value to add
Returns
None
Examples
// This example will build a DropDownValue list and a name/value pair of lists
var ddList = new List<DropDownValue>();
var textList = new List<string>();
var valList = new List<string>();
for(int i = 0; i < 10; i++)
{
ddList.Add(new DropDownValue("Entry " + i, i.ToString()));
textList.Add("Entry " + i);
valList.Add(i.ToString());
}
// Both of the following AddToDropDown calls will add the same ten entries
CurrentForm.FormControl("Dropdown1").AddToDropDown(ddList);
CurrentForm.FormControl("Dropdown2").AddToDropDown(textList,valList);
// The next AddToDropDown call will add only the numerical portion to the
// DropDown control
CurrentForm.FormControl("Dropdown3").AddToDropDown(valList);
// Items: 1, 2, 3, 4, etc.
// Add the entries "Item 1", "Item 2", and "Item 3" to the
// DropDown control
CurrentForm.FormControl("Dropdown4").AddToDropDown("Item 1", "Item 2",
"Item 3");


This API adds an item or list of items to a DropDown control, but clears the DropDown first. The API will attempt to re-select the previous value of the dropdown control, but won't select it if the value no longer exists in the DropDown. This is an overloaded method with the following possible declarations:
public void FillDropDown(IEnumerable<DropDownValue> DDList)
public void FillDropDown(DropDownValue DDV, params DropDownValue[] DDVs)
public void FillDropDown(IEnumerable<string> listText,
IEnumerable<string> listValues)
public void FillDropDown(IEnumerable<string> values)
public void FillDropDown(string Value, params string[] Values)
Parameters
DDList: DropDownValue objects or strings to add to the dropdown.
Item1, Item2, Item3, etc.: DropDown items to add to the DropDown control.
ListText: List of Text (name) values (use with ValuesList)
ListValues: List of Values to add to the dropdown (use with ListText)
Values: iEnumerable or Params object containing string values
Returns
None
Examples
// This example will build a DropDownValue list and a name/value
// pair of lists
var ddList = new List<DropDownValue>();
var textList = new List<string>();
var valList = new List<string>();
for(int i = 0; i < 10; i++)
{
ddList.Add(new FormControl.DropDownValue("Entry " + i, i.ToString()));
textList.Add("Entry " + i);
valList.Add(i.ToString());
}
// Both of the following AddToDropDown calls will fill the DropDown with
// the same ten entries
CurrentForm.FormControl("Dropdown1").FillDropDown(ddList);
CurrentForm.FormControl("Dropdown2").FillDropDown(textList, valList);
// The next AddToDropDown call will fill the DropDown with only the
// numerical portion
// Items: 1, 2, 3, 4, etc.
CurrentForm.FormControl("Dropdown3").FillDropDown(valList);
// Fill the DropDown with the entries "Item 1", "Item 2", and "Item 3"
CurrentForm.FormControl("Dropdown4").FillDropDown("Item 1", "Item 2",
"Item 3");


This API removes a row in an Array
Parameters
At: (Optional) The position of the row to remove. Without this parameter, the API will remove the last row in the Array.
Returns
Integer: The number of rows in the array after the Remove.
Examples
// This will remove the first row in "Array1"
CurrentForm.FormControl("Array1").RemoveRow(1);
// This will remove the last row in "Array1"
CurrentForm.FormControl("Array1").RemoveRow();


This API selects a value in the DropDown control. The API may add the value if it doesn't find it, depending on the parameters. This is an overloaded method with the following possible declarations:
public void SelectDropDown(string Value)
public void SelectDropDown(string Value, string Text)
public void SelectDropDown(string Value, bool AddIfNotFound)
public void SelectDropDown(List<string> Values)
Parameters
AddIfNotFound: (Optional) Whether or not to add an entry in the DropDown if the API can't find the value (true/false).
Text: (Optional) The text to add if the API can't find the value.
Value: The value to select in the DropDown.
Values: String list of values to select.
Returns
None
Examples
// This example will try to select the value "1", and will add
// "[1]"/"1" (name/value) to the DropDown if the API can't find
// "1" already in the DropDown
CurrentForm.FormControl("Dropdown1").SelectDropDown("1");
// This example will try to select the value "1", and will add
// "[Item 1]"/"1" (name/value) to the DropDown if the API can't find
// "1" already in the DropDown
CurrentForm.FormControl("Dropdown2").SelectDropDown("1", "Item 1");
// This example will try to select the value "1", and won't add
// anything to the DropDown if the API can't find "1" already in
// the DropDown
CurrentForm.FormControl("Dropdown3").SelectDropDown("1", false);


This API sorts the rows in an Array. This is an overloaded method with the following possible declarations:
public bool Sort(string PrimaryColumn)
public bool Sort(string PrimaryColumn, string SecondaryColumn)
public bool Sort(string PrimaryColumn, string SecondaryColumn,
string TertiaryColumn)
public bool Sort(string PrimaryColumn, bool Descending)
public bool Sort(string PrimaryColumn, string SecondaryColumn,
bool Descending)
public bool Sort(string PrimaryColumn, string SecondaryColumn,
string TertiaryColumn, bool Descending)
Parameters
PrimaryColumn: The name of the column which is the first sort key
SecondaryColumn: The optional name of the column which is the second sort key
TertiaryColumn: The optional name of the column which is the third sort key
Descending: Optional Boolean if set true will sort rows descending
Returns
None
Examples
// Sort the array
CurrentForm.FormControl("Array1").Sort("ColumnName");
Documentation Feedback and Questions
If you notice some way that this document can be improved, we're happy to hear your suggestions. Similarly, if you can't find an answer you're looking for, ask it via feedback. Simply click on the button below to provide us with your feedback or ask a question. Please remember, though, that not every issue can be addressed through documentation. So, if you have a specific technical issue with Process Director, please open a support ticket.