Version

FindStringExact(String,Int32) Method

FindString method
Syntax
'Declaration
 
Public Overloads Overrides Function FindStringExact( _
   ByVal s As String, _
   ByVal startIndex As Integer _
) As Integer
public override int FindStringExact( 
   string s,
   int startIndex
)

Parameters

s
The string to search for
startIndex
The index of the first item to to be included in the search

Return Value

The index of the first item that contains an exact match for the specified string
Example
This example uses the FindStringExact method to select an item by searching for the item's text.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinEditors

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        '	Set focus to the UltraComboEditor
        Me.UltraComboEditor1.Focus()

        '	Clear the existing list
        Me.UltraComboEditor1.Items.Clear()

        '	Add 5 items to the list
        Me.UltraComboEditor1.Items.Add(1, "One")
        Me.UltraComboEditor1.Items.Add(2, "Two")
        Me.UltraComboEditor1.Items.Add(3, "Three")
        Me.UltraComboEditor1.Items.Add(4, "Four")
        Me.UltraComboEditor1.Items.Add(5, "Five")

        '	Show the list portion
        Me.UltraComboEditor1.DropDown()

        '	Use the FindString method to determine the index of the
        '	item whose text is "Four"
        Dim index As Integer = Me.UltraComboEditor1.FindStringExact("Four", 0)

        '	Set the SelectedIndex property to the item we found
        '	via the call to the FindString method
        Me.UltraComboEditor1.SelectedIndex = index

    End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;

		private void button1_Click(object sender, System.EventArgs e)
		{
			//	Set focus to the UltraComboEditor
			this.ultraComboEditor1.Focus();

			//	Clear the existing list
			this.ultraComboEditor1.Items.Clear();
			
			//	Add 5 items to the list
			this.ultraComboEditor1.Items.Add( 1, "One" );
			this.ultraComboEditor1.Items.Add( 2, "Two" );
			this.ultraComboEditor1.Items.Add( 3, "Three" );
			this.ultraComboEditor1.Items.Add( 4, "Four" );
			this.ultraComboEditor1.Items.Add( 5, "Five" );
			
			//	Show the list portion
			this.ultraComboEditor1.DropDown();

			//	Use the FindString method to determine the index of the
			//	item whose text is "Four"
			int index = this.ultraComboEditor1.FindStringExact( "Four", 0 );

			//	Set the SelectedIndex property to the item we found
			//	via the call to the FindString method
			this.ultraComboEditor1.SelectedIndex = index;

		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also