Returns index of a C1ComboBoxItem by its Text property.
Namespace:
C1.Web.UI.Controls.C1ComboBoxAssembly: C1.Web.UI.Controls.3 (in C1.Web.UI.Controls.3.dll)
Syntax
C# |
---|
public int FindItemIndexByText( string text ) |
Visual Basic (Declaration) |
---|
Public Function FindItemIndexByText ( _ text As String _ ) As Integer |
Parameters
- text
- Type: System..::..String
Text 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")); // 1 is returned.int index = comboBox.FindItemIndexByText("text2"); |