DataSourceView.CanUpdate 속성

정의

현재 DataSourceView 개체와 연결된 DataSourceControl 개체가 ExecuteUpdate(IDictionary, IDictionary, IDictionary) 작업을 지원하는지 여부를 나타내는 값을 가져옵니다.

public:
 virtual property bool CanUpdate { bool get(); };
public virtual bool CanUpdate { get; }
member this.CanUpdate : bool
Public Overridable ReadOnly Property CanUpdate As Boolean

속성 값

Boolean

작업이 지원되면 true이고, 그렇지 않으면 false입니다. 기본 구현은 false를 반환합니다.

예제

다음 코드 예제에서는 재정의 하는 방법에 설명 합니다 CanUpdate 속성 및 ExecuteUpdate 확장 하는 클래스의 메서드는 DataSourceView 클래스. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DataSourceView 클래스입니다.

// The CsvDataSourceView does not currently
// permit update operations. You can modify or
// extend this sample to do so.
public override bool CanUpdate {
    get {
        return false;
    }
}
protected override int ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)
{
    throw new NotSupportedException();
}
   ' The CsvDataSourceView does not currently
   ' permit update operations. You can modify or
   ' extend this sample to do so.
   Public Overrides ReadOnly Property CanUpdate() As Boolean
      Get
         Return False
      End Get
   End Property

   Protected Overrides Function ExecuteUpdate(keys As IDictionary, _
                                              values As IDictionary, _
                                              oldValues As IDictionary) As Integer
      Throw New NotSupportedException()
   End Function 'ExecuteUpdate

End Class

설명

CanUpdate 속성 반영 뿐만 아니라 데이터 소스 컨트롤의 기능 뿐만 아니라 현재 작업을 수행할 적절 한 것입니다. 데이터 바인딩된 컨트롤을 지원 하더라도 예를 들어 합니다 ExecuteUpdate 작업의 경우 필요한 업데이트 명령이 나 일부 다른 데이터가 설정 되어 있지 않으면,는 CanUpdate 속성에서 반환 false업데이트 작업은 실패, 합니다.

적용 대상

추가 정보