ListViewInsertEventArgs.Values 속성

정의

삽입할 레코드의 값을 가져옵니다.

public:
 property System::Collections::Specialized::IOrderedDictionary ^ Values { System::Collections::Specialized::IOrderedDictionary ^ get(); };
public System.Collections.Specialized.IOrderedDictionary Values { get; }
member this.Values : System.Collections.Specialized.IOrderedDictionary
Public ReadOnly Property Values As IOrderedDictionary

속성 값

IOrderedDictionary

삽입할 레코드의 값입니다.

예제

다음 예제에서는 반복 하는 방법을 보여 줍니다는 Values 컬렉션입니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ListViewInsertEventArgs 클래스입니다.

void ContactsListView_ItemInserting(Object sender, ListViewInsertEventArgs e)
{
  // Iterate through the values to verify if they are not empty.
  foreach (DictionaryEntry de in e.Values)
  {
    if (de.Value == null)
    {
      Message.Text = "Cannot insert an empty value.";
      e.Cancel = true;
    }
  }
}
Sub ContactsListView_ItemInserting(ByVal sender As Object, _
                                   ByVal e As ListViewInsertEventArgs)

  ' Iterate through the values to verify if they are not empty.
  For Each de As DictionaryEntry In e.Values
    If de.Value Is Nothing Then
      Message.Text = "Cannot insert an empty value."
      e.Cancel = True
    End If
  Next
End Sub

설명

사용 된 Values 삽입할 레코드에 대 한 필드의 값에 액세스 하는 속성입니다. 예를 들어 유효성을 검사할 수 또는 데이터 원본에 삽입 될 HTML 인코딩 전에 레코드의 값입니다.

Values 속성이 반환을 OrderedDictionary 구현 하는 개체는 IOrderedDictionary 인터페이스. 합니다 OrderedDictionary 개체에 포함 되어 DictionaryEntry 레코드의 필드를 나타내는 개체입니다. 필드 이름에 액세스 하려면 사용 합니다 Keys 의 속성을 OrderedDictionary 개체. 필드 값에 액세스 하려면 사용 된 Values 속성입니다.

참고

가기로 인덱서를 사용할 수 있습니다는 OrderedDictionary 직접 값 필드에 액세스 하는 개체입니다. 인덱서를 사용 하 여의 장점은 필드 값이 직접 반환 된다는 것입니다. 데이터 소스 필드 순서에 의존 하는 컨트롤 (같은 AccessDataSource) 필드 값을 인덱스로 액세스할 수 있습니다.

적용 대상

추가 정보