다음을 통해 공유


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

속성 값

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

예제

다음 예제에서는 컬렉션을 반복 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 반환합니다. 개체에는 OrderedDictionaryDictionaryEntry 레코드의 필드를 나타내는 개체가 포함됩니다. 필드 이름에 액세스하려면 개체의 KeysOrderedDictionary 속성을 사용합니다. 필드 값에 액세스하려면 속성을 사용합니다 Values .

메모

바로 가기로 개체의 인덱서로 OrderedDictionary 필드 값에 직접 액세스할 수 있습니다. 인덱서를 사용할 경우의 장점은 필드 값을 직접 반환한다는 것입니다. 필드 순서(예: AccessDataSource)를 사용하는 데이터 원본 컨트롤은 인덱스로만 필드 값에 액세스할 수 있습니다.

적용 대상

추가 정보