Returns index of a C1ComboBoxItem by its Value property.
Namespace:
C1.Web.UI.Controls.C1ComboBoxAssembly: C1.Web.UI.Controls.3 (in C1.Web.UI.Controls.3.dll)
Syntax
C# |
---|
public int FindItemIndexByValue( string value ) |
Visual Basic (Declaration) |
---|
Public Function FindItemIndexByValue ( _ value As String _ ) As Integer |
Parameters
- value
- Type: System..::..String
Value used to match the item.
Return Value
Index of C1ComboBoxItem. If no match is found, -1 is returned.Examples
Copy CodeC#
C1ComboBox comboBox = new C1ComboBox(); comboBox.Items.Add(new C1ComboBoxItem("text1","value1")); comboBox.Items.Add(new C1ComboBoxItem("text2","value2")); // 0 is returned.int index = comboBox.FindItemIndexByValue("value1"); |