BindingSource.SupportsSearching 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
데이터 원본이 메서드를 사용하여 검색 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
속성 값
구현
- 특성
예제
다음 코드 예제에서는 멤버를 사용하는 방법을 보여 줍니다 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.