DataGridColumnStyle.PropertyDescriptorChanged イベントとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridColumnStyle.PropertyDescriptorChanged イベントの意味・解説 

DataGridColumnStyle.PropertyDescriptorChanged イベント

PropertyDescriptor プロパティの値が変更され場合発生します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Event PropertyDescriptorChanged As
 EventHandler
Dim instance As DataGridColumnStyle
Dim handler As EventHandler

AddHandler instance.PropertyDescriptorChanged, handler
public event EventHandler PropertyDescriptorChanged
/** @event */
public void add_PropertyDescriptorChanged (EventHandler
 value)

/** @event */
public void remove_PropertyDescriptorChanged
 (EventHandler value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例
 Private Sub myButton_Click(ByVal
 sender As Object, ByVal
 e As EventArgs)
     If TablesAlreadyAdded Then
         Return
     End If
     AddCustomDataTableStyle()
 End Sub 'myButton_Click

Private Sub AddCustomDataTableStyle()
   Dim myTableStyle As New
 DataGridTableStyle()
   ' Map DataGridTableStyle to a DataTable.
   myTableStyle.MappingName = "Orders"
   ' Get CurrencyManager object.
   Dim myCurrencyManager As CurrencyManager
 = CType(BindingContext(myDataSet, "Orders"), CurrencyManager)
   ' Use the CurrencyManager to get the PropertyDescriptor for column.
   Dim myPropertyDescriptor As PropertyDescriptor
 = myCurrencyManager.GetItemProperties()("Amount")
   ' Construct a 'DataGridColumnStyle' object changing its format to
 'Currency'.
   Dim myColumnStyle As DataGridTextBoxColumn
 = New DataGridTextBoxColumn(myPropertyDescriptor, "c",
 True)
   ' Add EventHandler function for PropertyDescriptorChanged Event.
   AddHandler myColumnStyle.PropertyDescriptorChanged, AddressOf
 MyPropertyDescriptor_Changed
   myTableStyle.GridColumnStyles.Add(myColumnStyle)
   ' Add the DataGridTableStyle instance to the GridTableStylesCollection.
   myDataGrid.TableStyles.Add(myTableStyle)
   TablesAlreadyAdded = True
End Sub 'AddCustomDataTableStyle

 Private Sub MyPropertyDescriptor_Changed(ByVal
 sender As Object, ByVal
 e As EventArgs)
     myLabel.Text = "Property Descriptor Property of DataGridColumnStyle
 has changed"
 End Sub 'MyPropertyDescriptor_Changed
private void myButton_Click(object sender,
 EventArgs e)
{
   if(TablesAlreadyAdded) 
   {
      return;
   }
   AddCustomDataTableStyle();
}
private void AddCustomDataTableStyle()
{
   DataGridTableStyle myTableStyle = new DataGridTableStyle();
   // Map DataGridTableStyle to a DataTable.
   myTableStyle.MappingName = "Orders";
   // Get CurrencyManager object.
   CurrencyManager myCurrencyManager = (CurrencyManager)BindingContext[myDataSet
,"Orders"];
   // Use the CurrencyManager to get the PropertyDescriptor for column.
   PropertyDescriptor myPropertyDescriptor = myCurrencyManager.GetItemProperties()["Amount"];
   // Construct a 'DataGridColumnStyle' object changing its format to
 'Currency'.
   DataGridColumnStyle myColumnStyle =  new DataGridTextBoxColumn(myPropertyDescriptor
,"c",true);
   // Add EventHandler function for PropertyDescriptorChanged Event.
   myColumnStyle.PropertyDescriptorChanged+=new System.EventHandler(MyPropertyDescriptor_Changed);
   myTableStyle.GridColumnStyles.Add(myColumnStyle);
   // Add the DataGridTableStyle instance to the GridTableStylesCollection.
 
   myDataGrid.TableStyles.Add(myTableStyle);
   TablesAlreadyAdded=true;
}
private void MyPropertyDescriptor_Changed(object
 sender,EventArgs e)
{
   myLabel.Text="Property Descriptor Property of DataGridColumnStyle has changed";
}
private:
   void myButton_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      if ( TablesAlreadyAdded )
      {
         return;
      }

      AddCustomDataTableStyle();
   }

   void AddCustomDataTableStyle()
   {
      DataGridTableStyle^ myTableStyle = gcnew DataGridTableStyle;
      
      // Map DataGridTableStyle to a DataTable.
      myTableStyle->MappingName = "Orders";
      
      // Get CurrencyManager object.
      CurrencyManager^ myCurrencyManager = dynamic_cast<CurrencyManager^>(BindingContext[myDataSet,
 "Orders"]);
      
      // Use the CurrencyManager to get the PropertyDescriptor for column.
      PropertyDescriptor^ myPropertyDescriptor = myCurrencyManager->GetItemProperties()[
 "Amount" ];
      
      // Construct a 'DataGridColumnStyle' object changing its format to
 'Currency'.
      DataGridColumnStyle^ myColumnStyle = gcnew DataGridTextBoxColumn( myPropertyDescriptor,"c",true
 );
      
      // Add EventHandler function for PropertyDescriptorChanged Event.
      myColumnStyle->PropertyDescriptorChanged += gcnew System::EventHandler(
 this, &myDataForm::MyPropertyDescriptor_Changed );
      myTableStyle->GridColumnStyles->Add( myColumnStyle );
      
      // Add the DataGridTableStyle instance to the GridTableStylesCollection.
      myDataGrid->TableStyles->Add( myTableStyle );
      TablesAlreadyAdded = true;
   }

   void MyPropertyDescriptor_Changed( Object^ /*sender*/, EventArgs^
 /*e*/ )
   {
      myLabel->Text = "Property Descriptor Property of DataGridColumnStyle
 has changed";
   }
protected void myButton_Click(Object sender,
 EventArgs e)
{
    if (TablesAlreadyAdded) {
        return;
    }
    AddCustomDataTableStyle();
} //myButton_Click

private void AddCustomDataTableStyle()
{
    DataGridTableStyle myTableStyle = new DataGridTableStyle();

    // Map DataGridTableStyle to a DataTable.
    myTableStyle.set_MappingName("Orders");

    // Get CurrencyManager object.
    CurrencyManager myCurrencyManager = (CurrencyManager)
        get_BindingContext().get_Item(myDataSet, "Orders");

    // Use the CurrencyManager to get the PropertyDescriptor for column.
    PropertyDescriptor myPropertyDescriptor = 
        myCurrencyManager.GetItemProperties().get_Item("Amount");

    // Construct a 'DataGridColumnStyle' object changing its format
 to 
    // 'Currency'.
    DataGridColumnStyle myColumnStyle = 
        new DataGridTextBoxColumn(myPropertyDescriptor, "c",
 true);

    // Add EventHandler function for PropertyDescriptorChanged Event.
    myColumnStyle.add_PropertyDescriptorChanged(new System.EventHandler(
        MyPropertyDescriptorChanged));
    myTableStyle.get_GridColumnStyles().Add(myColumnStyle);

    // Add the DataGridTableStyle instance to the GridTableStylesCollection.
 
    myDataGrid.get_TableStyles().Add(myTableStyle);
    TablesAlreadyAdded = true;
} //AddCustomDataTableStyle

void MyPropertyDescriptorChanged(Object sender, EventArgs e)
{
    myLabel.set_Text("Property Descriptor Property of " 
        + "DataGridColumnStyle has changed");
} //MyPropertyDescriptorChanged
protected void myButton_Click(Object sender,
 EventArgs e)
{
    if(TablesAlreadyAdded) {
        return;
    }
    AddCustomDataTableStyle();
} //myButton_Click

private void AddCustomDataTableStyle()
{
    DataGridTableStyle myTableStyle = new DataGridTableStyle();

    // Map DataGridTableStyle to a DataTable.
    myTableStyle.set_MappingName("Orders");

    // Get CurrencyManager object.
    CurrencyManager myCurrencyManager = (CurrencyManager)
        get_BindingContext().get_Item(myDataSet, "Orders");

    // Use the CurrencyManager to get the PropertyDescriptor for column.
    PropertyDescriptor myPropertyDescriptor = myCurrencyManager.
        GetItemProperties().get_Item("Amount");

    // Construct a 'DataGridColumnStyle' object changing its format
 to 
    // 'Currency'.
    DataGridColumnStyle myColumnStyle = 
        new DataGridTextBoxColumn(myPropertyDescriptor, "c",
 true);

    // Add EventHandler function for PropertyDescriptorChanged Event.
    myColumnStyle.add_PropertyDescriptorChanged(new System.
        EventHandler(MyPropertyDescriptorChanged));
    myTableStyle.get_GridColumnStyles().Add(myColumnStyle);

    // Add the DataGridTableStyle instance to the 
    // GridTableStylesCollection. 
    myDataGrid.get_TableStyles().Add(myTableStyle);
    TablesAlreadyAdded = true;
} //AddCustomDataTableStyle

void MyPropertyDescriptorChanged(Object sender, EventArgs e)
{
    myLabel.set_Text("Property Descriptor Property of " 
        + "DataGridColumnStyle has changed");
} //MyPropertyDescriptorChanged
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridColumnStyle クラス
DataGridColumnStyle メンバ
System.Windows.Forms 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataGridColumnStyle.PropertyDescriptorChanged イベントを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataGridColumnStyle.PropertyDescriptorChanged イベントを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataGridColumnStyle.PropertyDescriptorChanged イベント を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DataGridColumnStyle.PropertyDescriptorChanged イベントのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridColumnStyle.PropertyDescriptorChanged イベントのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS