// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void FindStringExactFromGcComboBox()
{
// Creates the GcComboBox
GcComboBox gcComboBox1 = new GcComboBox();
// Creates items for the GcComboBox.
this.CreateItemsForFindStringExact(gcComboBox1);
// The FindString can find out all the ListItem which contians a SubItem with the "AA" value
// and another SubItem with the "001" value.
MatchedComboItemCollection collection = gcComboBox1.FindStringExact("AA (Tel) 001", "[0] (Tel) [1]");
}
public void CreateItemsForFindStringExact(GcComboBox gcComboBox)
{
ListItem listItem1 = new ListItem();
SubItem subItem1 = new SubItem();
SubItem subItem2 = new SubItem();
ListItem listItem2 = new ListItem();
SubItem subItem3 = new SubItem();
SubItem subItem4 = new SubItem();
ListItem listItem3 = new ListItem();
SubItem subItem5 = new SubItem();
SubItem subItem6 = new SubItem();
ListItem listItem4 = new ListItem();
SubItem subItem7 = new SubItem();
SubItem subItem8 = new SubItem();
ListItem listItem5 = new ListItem();
SubItem subItem9 = new SubItem();
SubItem subItem10 = new SubItem();
ListColumn listColumn1 = new ListColumn();
ListColumn listColumn2 = new ListColumn();
subItem1.Value = "AA";
subItem2.Value = "001";
listItem1.SubItems.AddRange(new SubItem[] {
subItem1,
subItem2});
subItem3.Value = "BB";
subItem4.Value = "002";
listItem2.SubItems.AddRange(new SubItem[] {
subItem3,
subItem4});
subItem5.Value = "CC";
subItem6.Value = "003";
listItem3.SubItems.AddRange(new SubItem[] {
subItem5,
subItem6});
subItem7.Value = "AA";
subItem8.Value = "004";
listItem4.SubItems.AddRange(new SubItem[] {
subItem7,
subItem8});
subItem9.Value = "aa";
subItem10.Value = "001";
listItem5.SubItems.AddRange(new SubItem[] {
subItem9,
subItem10});
gcComboBox.Items.AddRange(new ListItem[] {
listItem1,
listItem2,
listItem3,
listItem4,
listItem5});
gcComboBox.ListColumns.AddRange(new ListColumn[] { listColumn1, listColumn2 });
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub FindStringExactFromGcComboBox()
' Creates the GcComboBox
Dim gcComboBox1 As New GcComboBox()
' Creates items for the GcComboBox.
Me.CreateItemsForFindStringExact(gcComboBox1)
' The FindString can find out all the ListItem which contians a SubItem with the "AA" value
' and another SubItem with the "001" value.
Dim collection As MatchedComboItemCollection = gcComboBox1.FindStringExact("AA (Tel) 001", "[0] (Tel) [1]")
End Sub
Public Sub CreateItemsForFindStringExact(ByVal gcComboBox As GcComboBox)
Dim listItem1 As New ListItem()
Dim subItem1 As New SubItem()
Dim subItem2 As New SubItem()
Dim listItem2 As New ListItem()
Dim subItem3 As New SubItem()
Dim subItem4 As New SubItem()
Dim listItem3 As New ListItem()
Dim subItem5 As New SubItem()
Dim subItem6 As New SubItem()
Dim listItem4 As New ListItem()
Dim subItem7 As New SubItem()
Dim subItem8 As New SubItem()
Dim listItem5 As New ListItem()
Dim subItem9 As New SubItem()
Dim subItem10 As New SubItem()
Dim listColumn1 As New ListColumn()
Dim listColumn2 As New ListColumn()
subItem1.Value = "AA"
subItem2.Value = "001"
listItem1.SubItems.AddRange(New SubItem() {subItem1, subItem2})
subItem3.Value = "BB"
subItem4.Value = "002"
listItem2.SubItems.AddRange(New SubItem() {subItem3, subItem4})
subItem5.Value = "CC"
subItem6.Value = "003"
listItem3.SubItems.AddRange(New SubItem() {subItem5, subItem6})
subItem7.Value = "AA"
subItem8.Value = "004"
listItem4.SubItems.AddRange(New SubItem() {subItem7, subItem8})
subItem9.Value = "aa"
subItem10.Value = "001"
listItem5.SubItems.AddRange(New SubItem() {subItem9, subItem10})
gcComboBox.Items.AddRange(New ListItem() {listItem1, listItem2, listItem3, listItem4, listItem5})
gcComboBox.ListColumns.AddRange(New ListColumn() {listColumn1, listColumn2})
End Sub