BindingSource.SupportsSearching 속성

정의

데이터 소스에서 Find(PropertyDescriptor, Object) 메서드를 사용한 검색을 지원하는지 여부를 나타내는 값을 가져옵니다.

public:
 virtual property bool SupportsSearching { bool get(); };
[System.ComponentModel.Browsable(false)]
public virtual bool SupportsSearching { get; }
[<System.ComponentModel.Browsable(false)>]
member this.SupportsSearching : bool
Public Overridable ReadOnly Property SupportsSearching As Boolean

속성 값

Boolean

목록이 IBindingList이고 Find 메서드를 사용한 검색을 지원하면 true이고, 그렇지 않으면 false입니다.

구현

특성

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 SupportsSearching 멤버입니다. 전체 예제 클래스 개요 항목을 참조 하세요.

private void button1_Click(object sender, EventArgs e)
{
    if (binding1.SupportsSearching != true)
    {
        MessageBox.Show("Cannot search the list.");
    }
    else
    {
        int foundIndex = binding1.Find("Name", textBox1.Text);
        if (foundIndex > -1)
            listBox1.SelectedIndex = foundIndex;
        else
            MessageBox.Show("Font was not found.");
    }
}
    Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) _
        Handles button1.Click

        If binding1.SupportsSearching <> True Then
            MessageBox.Show("Cannot search the list.")
        Else
            Dim foundIndex As Integer = binding1.Find("Name", textBox1.Text)
            If foundIndex > -1 Then
                listBox1.SelectedIndex = foundIndex
            Else
                MessageBox.Show("Font was not found.")
            End If
        End If

    End Sub
End Class

설명

데이터 원본에 없는 경우는 IBindingList, SupportsSearching 항상 반환 false합니다.

적용 대상