ClassHtmlSelect
Test class for an HtmlSelect element <select>...</select>
Definition
Namespace:ArtOfTest.WebAii.Controls.HtmlControls
Assembly:ArtOfTest.WebAii.dll
Syntax:
public class HtmlSelect : HtmlContainerControl
Inheritance: objectControlHtmlControlHtmlContainerControlHtmlSelect
Inherited Members
Constructors
HtmlSelect(Element)
Create a new control.
Declaration
public HtmlSelect(Element element)
Parameters
element
The base element.
Properties
Options
Gets the List of Options.
Declaration
public ReadOnlyCollection<HtmlOption> Options { get; }
Property Value
SelectedIndex
Gets the selected index.
SelectedOption
Gets the HtmlOption that is currently selected.
this[int]
Gets Html Option by its index.
Declaration
public HtmlOption this[int index] { get; }
Parameters
index
The desired index.
Property Value
The html option.
Methods
AssignElement(Element)
Assign element and initialize this control.
Declaration
public override void AssignElement(Element e)
Parameters
e
The base element.
Overrides
InvokeOnChange(bool)
Declaration
protected virtual void InvokeOnChange(bool initEvent)
Parameters
initEvent
MultiSelect(params HtmlOption[])
Multi select a set of options on the select drop down. You can also set the .Selected value on any HtmlOption.
Declaration
public void MultiSelect(params HtmlOption[] options)
Parameters
options
The list of options to select. These can be accessed fro the Options[] collection.
MultiSelectByIndex(params int[])
Multi select a set of options by passing in the indexes of these options.
Declaration
public void MultiSelectByIndex(params int[] indexes)
Parameters
indexes
int[]
The indexes to select
MultiSelectByText(params string[])
Multi select a set of options by passing in the text of these options.
Declaration
public void MultiSelectByText(params string[] textStrings)
Parameters
textStrings
string[]
The array of strings option texts to select.
MultiSelectByValue(params string[])
Mutli select a set of options by passing in the values of these options to select.
Declaration
public void MultiSelectByValue(params string[] values)
Parameters
values
string[]
The arrary of value of options to select.
SelectByIndex(int)
Select a option by index.
Declaration
public void SelectByIndex(int index)
Parameters
index
Index to select.
SelectByIndex(int, bool, bool)
Select ption by Index.
Declaration
public void SelectByIndex(int index, bool invokeOnChangeEvent, bool initEvent = true)
Parameters
index
Index to select.
invokeOnChangeEvent
Whether to invoke the OnChange event.
initEvent
Whether to try to invoke selection changed using the initEvent JS function
SelectByPartialText(string, bool)
Select an option by partial text.
Declaration
public void SelectByPartialText(string partialText, bool invokeOnChangeEvent)
Parameters
partialText
The partial text to look for.
invokeOnChangeEvent
Whether to invoke the onchange event.
Exceptions
Thrown when an option containing the partial text was not found.
SelectByPartialValue(string, bool)
Select an option by partial value.
Declaration
public void SelectByPartialValue(string partialValue, bool invokeOnChangeEvent)
Parameters
partialValue
The partial text to look for.
invokeOnChangeEvent
Whether to invoke the onchange event.
Exceptions
Thrown when an option containing the partial value was not found.
SelectByText(string)
Select a option by text.
Declaration
public void SelectByText(string text)
Parameters
text
Text of the option to select.
SelectByText(string, bool, bool)
Select Option by Text.
Declaration
public void SelectByText(string text, bool invokeOnChangeEvent, bool initEvent = true)
Parameters
text
Text of the option to select.
invokeOnChangeEvent
Whether to invoke the OnChange event.
initEvent
Whether to try to invoke selection changed using the initEvent JS function
SelectByValue(string)
Select Option by Value.
Declaration
public void SelectByValue(string value)
Parameters
value
Value of option to select.
SelectByValue(string, bool, bool)
Select Option by Value.
Declaration
public void SelectByValue(string value, bool invokeOnChangeEvent, bool initEvent = true)
Parameters
value
Value of option to select.
invokeOnChangeEvent
Whether to invoke the onchange event.
initEvent
Whether to try to invoke selection changed using the initEvent JS function