DataGridColumnStyle.PropertyDescriptor 속성

정의

PropertyDescriptor이 표시하는 데이터의 특성을 결정하는 DataGridColumnStyle을 가져오거나 설정합니다.

public:
 virtual property System::ComponentModel::PropertyDescriptor ^ PropertyDescriptor { System::ComponentModel::PropertyDescriptor ^ get(); void set(System::ComponentModel::PropertyDescriptor ^ value); };
[System.ComponentModel.Browsable(false)]
public virtual System.ComponentModel.PropertyDescriptor PropertyDescriptor { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.PropertyDescriptor : System.ComponentModel.PropertyDescriptor with get, set
Public Overridable Property PropertyDescriptor As PropertyDescriptor

속성 값

PropertyDescriptor

열의 특성에 대한 데이터가 들어 있는 PropertyDescriptor입니다.

특성

예제

다음 코드 예제에서는 PropertyDescriptor 에 있는 GridColumnStylesCollection열의 가져옵니다. 두 번째 예제에서는 .을 사용하여 새로 DataGridColumnStyle PropertyDescriptor만듭니다.

private:
   void GetPropertyDescriptor()
   {
      PropertyDescriptor^ pd;
      pd = dataGrid1->TableStyles[ 0 ]->GridColumnStyles[ 0 ]->PropertyDescriptor;
      Console::WriteLine( pd );
   }

   void CreateNewDataGridColumnStyle()
   {
      GridColumnStylesCollection^ myGridColumnCol;
      myGridColumnCol = dataGrid1->TableStyles[ 0 ]->GridColumnStyles;
      
      // Get the CurrencyManager for the table you want to add a column to.
      CurrencyManager^ myCurrencyManager = dynamic_cast<CurrencyManager^>(this->BindingContext[ ds->Tables[ "Suppliers" ] ]);
      
      // Get the PropertyDescriptor for the DataColumn of the new column.
      PropertyDescriptor^ pd = myCurrencyManager->GetItemProperties()[ "City" ];
      DataGridColumnStyle^ myColumn = gcnew DataGridTextBoxColumn( pd );
      myGridColumnCol->Add( myColumn );
   }
private void GetPropertyDescriptor()
{
    PropertyDescriptor pd;
    pd = dataGrid1.TableStyles[0].GridColumnStyles[0].PropertyDescriptor;
    Console.WriteLine(pd.ToString());
}
 
private void CreateNewDataGridColumnStyle()
{
    GridColumnStylesCollection myGridColumnCol;
    myGridColumnCol = dataGrid1.TableStyles[0].GridColumnStyles;
    // Get the CurrencyManager for the table you want to add a column to.
    CurrencyManager myCurrencyManager = (CurrencyManager)this.BindingContext[ds.Tables["Suppliers"]];
    // Get the PropertyDescriptor for the DataColumn of the new column.
    PropertyDescriptor pd = myCurrencyManager.GetItemProperties()["City"];
    DataGridColumnStyle myColumn = new DataGridTextBoxColumn(pd);
    myGridColumnCol.Add(myColumn);
 }
Private Sub GetPropertyDescriptor()
    Dim pd As PropertyDescriptor
    pd = dataGrid1.TableStyles(0).GridColumnStyles(0).PropertyDescriptor
    Console.WriteLine(pd.ToString())
End Sub


Private Sub CreateNewDataGridColumnStyle()
    Dim myGridColumnCol As GridColumnStylesCollection
    myGridColumnCol = dataGrid1.TableStyles(0).GridColumnStyles
    ' Get the CurrencyManager for the table you want to add a column to.
    Dim myCurrencyManager As CurrencyManager = CType(Me.BindingContext(ds.Tables("Suppliers")), CurrencyManager)
    ' Get the PropertyDescriptor for the DataColumn of the new column.
    Dim pd As PropertyDescriptor = myCurrencyManager.GetItemProperties()("City")
    Dim myColumn As New DataGridTextBoxColumn(pd)
    myGridColumnCol.Add(myColumn)
End Sub

설명

열에 PropertyDescriptor 대한 값은 .의 메서드를 GetItemProperties 사용하여 설정됩니다 BindingManagerBase. DataGridColumnStyleDataGridColumnStyle만들기를 사용하는 PropertyDescriptor 예제는 생성자를 참조하세요.

적용 대상

추가 정보