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

속성 값

목록이 a이고 메서드를 사용하여 검색 을 지원하면 />이고, 그렇지 않으면 .

구현

특성

예제

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

void button1_Click(object sender, EventArgs e)
{
    if (!binding1.SupportsSearching)
    {
        _ = 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.

적용 대상