DataGridTableStyleとは? わかりやすく解説

DataGridTableStyle イベント


パブリック イベントパブリック イベント

  名前 説明
パブリック イベント Disposed  コンポーネントDisposed イベント待機するイベント ハンドラ追加します。 ( Component から継承されます。)
パブリック イベント ForeColorChanged ForeColor の値が変更され場合発生します
パブリック イベント GridLineColorChanged GridLineColor の値が変更され場合発生します
パブリック イベント GridLineStyleChanged GridLineStyle の値が変更され場合発生します
パブリック イベント HeaderBackColorChanged HeaderBackColor の値が変更され場合発生します
パブリック イベント HeaderFontChanged HeaderFont の値が変更され場合発生します
パブリック イベント HeaderForeColorChanged HeaderForeColor の値が変更され場合発生します
パブリック イベント LinkColorChanged LinkColor の値が変更され場合発生します
パブリック イベント LinkHoverColorChanged LinkHoverColor の値が変更され場合発生します
パブリック イベント MappingNameChanged MappingName の値が変更され場合発生します
パブリック イベント PreferredColumnWidthChanged PreferredColumnWidth プロパティの値が変更され場合発生します
パブリック イベント PreferredRowHeightChanged PreferredRowHeight の値が変更され場合発生します
パブリック イベント ReadOnlyChanged ReadOnly の値が変更され場合発生します
パブリック イベント RowHeadersVisibleChanged RowHeadersVisible の値が変更され場合発生します
パブリック イベント RowHeaderWidthChanged RowHeaderWidth の値が変更され場合発生します
パブリック イベント SelectionBackColorChanged SelectionBackColor の値が変更され場合発生します
パブリック イベント SelectionForeColorChanged SelectionForeColor の値が変更され場合発生します
参照参照

関連項目

DataGridTableStyle クラス
System.Windows.Forms 名前空間
DataGrid クラス
DataGridColumnStyle クラス
GridColumnStylesCollection
GridTableStylesCollection

DataGridTableStyle クラス

System.Windows.Forms.DataGrid コントロールによって実行時描画されるテーブル表します

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

Public Class DataGridTableStyle
    Inherits Component
    Implements IDataGridEditingService
Dim instance As DataGridTableStyle
public class DataGridTableStyle : Component,
 IDataGridEditingService
public ref class DataGridTableStyle : public
 Component, IDataGridEditingService
public class DataGridTableStyle extends Component
 implements IDataGridEditingService
public class DataGridTableStyle extends
 Component implements IDataGridEditingService
解説解説

System.Windows.Forms.DataGrid コントロールは、グリッド形式データ表示しますDataGridTableStyle は、描画されグリッドだけを表すクラスです。このグリッドは、グリッドデータ ソースとなる DataTable クラスとは区別する必要がありますDataGridTableStyle は、コントロール描画されたとおりに正確にグリッド表しますこのためDataGridTableStyle使用すると、各 DataTableグリッド外観制御できます特定の DataTableデータ表示するときに使用する DataGridTableStyle指定するには、MappingName を DataTable の TableName に設定します

TableStyles プロパティによって取得される GridTableStylesCollection には、System.Windows.Forms.DataGrid コントロール使用される DataGridTableStyle オブジェクトがすべて格納されます。このコレクションには、必要な数の DataGridTableStyle オブジェクト格納できますが、各オブジェクトMappingName一意である必要があります。これにより、同じデータに対してユーザー設定に応じて実行時異なDataGridTableStyle適用できます上記の処理を実現するには、次の操作実行します

  1. GridTableStylesCollectionDataGridTableStyle オブジェクト格納しますDataGridTableStyleGridTableStylesCollection 内に存在し、その MappingName プロパティ値が DataTable オブジェクトTableName プロパティ等し場合DataTable はこの DataGridTableStyle使用して表示されます。一致する MappingName 値を持つ DataGridTableStyle存在しない場合DataTableデータ グリッド テーブル既定スタイル使用して表示されます。

  2. 別のグリッド スタイル必要な場合は、Item プロパティ使用して適切な DataGridTableStyle選択し (TableNameItem プロパティに渡す)、返されオブジェクトMappingName新しい値に設定します

  3. Item プロパティ使用して必要な DataGridTableStyle選択し、その MappingNameDataTableTableName設定します

注意に関するメモ注意

必ず DataGridColumnStyle オブジェクト作成して GridColumnStylesCollection に追加してから、DataGridTableStyle オブジェクトGridTableStylesCollection追加します有効な MappingName 値を持つ空の DataGridTableStyleコレクション追加すると、自動的に DataGridColumnStyle オブジェクト生成されます。そのため、MappingName 値が重複する新しDataGridColumnStyle オブジェクトGridColumnStylesCollection追加しようとすると、例外スローさます。

現在表示されている DataGridTableStyle確認するには、System.Windows.Forms.DataGrid の DataSource プロパティと DataMember プロパティ使用して、CurrencyManager を返しますデータ ソースに ITypedList インターフェイス実装されている場合は、GetListName メソッド使用すると、現在のテーブルMappingName返すことができます上記の例を次の C# コード示します

 private void PrintCurrentListName(DataGrid myDataGrid){
  CurrencyManager myCM = (CurrencyManager)
  BindingContext[myDataGrid.DataSource, myDataGrid.DataMember];
  IList myList = myCM.List;
  ITypedList thisList = (ITypedList) myList;
  Console.WriteLine(thisList.GetListName(null));
 }

DataSet 内に DataRelation オブジェクトによって関連付けられている複数DataTable オブジェクト格納されていて、現在表示されている DataTable が子テーブルである場合DataMember は、TableName.RelationName という形式 (最も簡単な場合) の文字列返しますDataTable階層構造内のさらに下位位置する場合、この文字列は、親テーブルの名前に、そのテーブルレベル到達するために必要な RelationName 値が続く形で表されます。たとえば、階層的なリレーションシップ持ち、上から順に RegionsCustomers、および Orders という名前が付いている 3 つの DataTable オブジェクトと、RegionsToCustomers および CustomersToOrders という名前の 2 つDataRelation オブジェクトがある場合DataMember プロパティは、"Regions.RegionsToCustomers.CustomersToOrders" を返します。ただし、この場合MappingName は "Orders" になります

DataGridTableStyle オブジェクトコレクションは、System.Windows.Forms.DataGridTableStyles プロパティによって返されます。

DataGridTableStyle表示されると、その DataGridTableStyle設定値によって System.Windows.Forms.DataGrid コントロール設定値オーバーライドされます特定の DataGridTableStyle プロパティに値が設定されていない場合は、代わりに System.Windows.Forms.DataGrid コントロールの値が使用されます。System.Windows.Forms.DataGrid コントロールプロパティオーバーライドするために設定できる DataGridColumnStyle プロパティ次に示します

  • AllowSorting

  • AlternatingBackColor

  • BackColor

  • ColumnHeadersVisible

  • ForeColor

  • GridLineColor

  • GridLineStyle

  • HeaderBackColor

  • HeaderFont

  • HeaderForeColor

  • LinkColor

  • PreferredColumnWidth

  • PreferredRowHeight

  • ReadOnly

  • RowHeadersVisible

  • RowHeaderWidth

  • SelectionBackColor

  • SelectionForeColor

DataGridオブジェクト厳密に指定され配列バインドするには、オブジェクト型パブリック プロパティ含まれている必要があります配列表示する DataGridTableStyle作成するには、DataGridTableStyle.MappingName プロパティtypename設定します。なお、この typename実際オブジェクト型名に置き換えてくださいまた、MappingName プロパティでは大文字と小文字区別されることに注意してください。型の名前は正確に指定する必要があります例については、MappingName プロパティトピック参照してください

また、DataGrid を ArrayList にバインドできますArrayList特長は、複数の型のオブジェクト格納できることです。ただし、DataGridリスト内のすべての項目の型が 1 番目の項目の型と同じ場合限りリストバインドできます。つまり、すべてのオブジェクトの型が同じであるか、リスト内の最初の項目と同じクラスからすべてのクラス継承している必要があります。たとえば、リスト内の最初の項目が Control場合2 番目の項目は (Control から継承した) TextBoxできます逆に、1 番目の項目が TextBox場合2 番目のオブジェクトControl になることはできません。さらに、ArrayListバインドされている場合には項目が含まれている必要があり、DataGridTableStyle 内のオブジェクトパブリック プロパティ含まれている必要があります。空の ArrayList場合、空のグリッドとなりますArrayListバインディングするときは、DataGridTableStyleMappingName を "ArrayList" (型の名前) に設定します

使用例使用例

2 つDataGridTableStyle インスタンス作成し、各オブジェクトMappingNameDataSet 内の DataTableTableName設定するコード例次に示します。さらに、この例では DataGridColumnStyle オブジェクトを各 DataGridTableStyle オブジェクトGridColumnStylesCollection追加してます。実行例については、System.Windows.Forms.DataGridトピック参照してください

Private Sub AddCustomDataTableStyle()
    ' Create a new DataGridTableStyle and set
    ' its MappingName to the TableName of a DataTable. 
    Dim ts1 As New DataGridTableStyle()
    ts1.MappingName = "Customers"
    
    ' Add a GridColumnStyle and set its MappingName
    ' to the name of a DataColumn in the DataTable.
    ' Set the HeaderText and Width properties. 
    
    Dim boolCol As New DataGridBoolColumn()
    boolCol.MappingName = "Current"
    boolCol.HeaderText = "IsCurrent Customer"
    boolCol.Width = 150
    ts1.GridColumnStyles.Add(boolCol)
    
    ' Add a second column style.
    Dim TextCol As New DataGridTextBoxColumn()
    TextCol.MappingName = "custName"
    TextCol.HeaderText = "Customer Name"
    TextCol.Width = 250
    ts1.GridColumnStyles.Add(TextCol)

    ' Create the second table style with columns.
    Dim ts2 As New DataGridTableStyle()
    ts2.MappingName = "Orders"

    ' Change the colors.
    ts2.ForeColor = Color.Yellow
    ts2.AlternatingBackColor = Color.Blue
    ts2.BackColor = Color.Blue
    
    ' Create new DataGridColumnStyle objects.
    Dim cOrderDate As New
 DataGridTextBoxColumn()
    cOrderDate.MappingName = "OrderDate"
    cOrderDate.HeaderText = "Order Date"
    cOrderDate.Width = 100
    ts2.GridColumnStyles.Add(cOrderDate)
    
    Dim pcol As PropertyDescriptorCollection
 = Me.BindingContext(myDataSet, "Customers.custToOrders").GetItemProperties()
    
    Dim csOrderAmount As New
 DataGridTextBoxColumn(pcol("OrderAmount"), "c",
 True)
    csOrderAmount.MappingName = "OrderAmount"
    csOrderAmount.HeaderText = "Total"
    csOrderAmount.Width = 100
    ts2.GridColumnStyles.Add(csOrderAmount)

    ' Add the DataGridTableStyle objects to the collection.
    myDataGrid.TableStyles.Add(ts1)
    myDataGrid.TableStyles.Add(ts2)
End Sub 'AddCustomDataTableStyle
private void AddCustomDataTableStyle()
   {
      /* Create a new DataGridTableStyle and set
      its MappingName to the TableName of a DataTable. */
      DataGridTableStyle ts1 = new DataGridTableStyle();
      ts1.MappingName = "Customers";

      /* Add a GridColumnStyle and set its MappingName 
      to the name of a DataColumn in the DataTable. 
      Set the HeaderText and Width properties. */
      
      DataGridColumnStyle boolCol = new DataGridBoolColumn();
      boolCol.MappingName = "Current";
      boolCol.HeaderText = "IsCurrent Customer";
      boolCol.Width = 150;
      ts1.GridColumnStyles.Add(boolCol);
      
      // Add a second column style.
      DataGridColumnStyle TextCol = new DataGridTextBoxColumn();
      TextCol.MappingName = "custName";
      TextCol.HeaderText = "Customer Name";
      TextCol.Width = 250;
      ts1.GridColumnStyles.Add(TextCol);


      // Create the second table style with columns.
      DataGridTableStyle ts2 = new DataGridTableStyle();
      ts2.MappingName = "Orders";
      // Change the colors.
      ts2.ForeColor = Color.Yellow;
      ts2.AlternatingBackColor = Color.Blue;
      ts2.BackColor = Color.Blue;
      
      // Create new DataGridColumnStyle objects.
      DataGridColumnStyle cOrderDate = 
      new DataGridTextBoxColumn();
      cOrderDate.MappingName = "OrderDate";
      cOrderDate.HeaderText = "Order Date";
      cOrderDate.Width = 100;
      ts2.GridColumnStyles.Add(cOrderDate);

      PropertyDescriptorCollection pcol = this.BindingContext
      [myDataSet, "Customers.custToOrders"].GetItemProperties();
      
      DataGridColumnStyle csOrderAmount = 
      new DataGridTextBoxColumn(pcol["OrderAmount"],
 "c", true);
      csOrderAmount.MappingName = "OrderAmount";
      csOrderAmount.HeaderText = "Total";
      csOrderAmount.Width = 100;
      ts2.GridColumnStyles.Add(csOrderAmount);

      // Add the DataGridTableStyle objects to the collection.
      myDataGrid.TableStyles.Add(ts1);
      myDataGrid.TableStyles.Add(ts2);
   }

void AddCustomDataTableStyle()
{
   
   /* Create a new DataGridTableStyle and set
         its MappingName to the TableName of a DataTable. */
   DataGridTableStyle^ ts1 = gcnew DataGridTableStyle;
   ts1->MappingName = "Customers";
   
   /* Add a GridColumnStyle and set its MappingName 
         to the name of a DataColumn in the DataTable. 
         Set the HeaderText and Width properties. */
   DataGridColumnStyle^ boolCol = gcnew DataGridBoolColumn;
   boolCol->MappingName = "Current";
   boolCol->HeaderText = "IsCurrent Customer";
   boolCol->Width = 150;
   ts1->GridColumnStyles->Add( boolCol );
   
   // Add a second column style.
   DataGridColumnStyle^ TextCol = gcnew DataGridTextBoxColumn;
   TextCol->MappingName = "custName";
   TextCol->HeaderText = "Customer Name";
   TextCol->Width = 250;
   ts1->GridColumnStyles->Add( TextCol );
   
   // Create the second table style with columns.
   DataGridTableStyle^ ts2 = gcnew DataGridTableStyle;
   ts2->MappingName = "Orders";
   
   // Change the colors.
   ts2->ForeColor = Color::Yellow;
   ts2->AlternatingBackColor = Color::Blue;
   ts2->BackColor = Color::Blue;
   
   // Create new DataGridColumnStyle objects.
   DataGridColumnStyle^ cOrderDate = gcnew DataGridTextBoxColumn;
   cOrderDate->MappingName = "OrderDate";
   cOrderDate->HeaderText = "Order Date";
   cOrderDate->Width = 100;
   ts2->GridColumnStyles->Add( cOrderDate );
   PropertyDescriptorCollection^ pcol = this->BindingContext[
 myDataSet,"Customers.custToOrders" ]->GetItemProperties();
   DataGridColumnStyle^ csOrderAmount = gcnew DataGridTextBoxColumn( pcol[ "OrderAmount"
 ],"c",true );
   csOrderAmount->MappingName = "OrderAmount";
   csOrderAmount->HeaderText = "Total";
   csOrderAmount->Width = 100;
   ts2->GridColumnStyles->Add( csOrderAmount );
   
   // Add the DataGridTableStyle objects to the collection.
   myDataGrid->TableStyles->Add( ts1 );
   myDataGrid->TableStyles->Add( ts2 );
}

private void AddCustomDataTableStyle()
{
    /*  Create a new DataGridTableStyle and set
        its MappingName to the TableName of a DataTable. 
     */
    DataGridTableStyle ts1 = new DataGridTableStyle();
    ts1.set_MappingName("Customers");
    /*  Add a GridColumnStyle and set its MappingName 
        to the name of a DataColumn in the DataTable. 
        Set the HeaderText and Width properties. 
     */
    
    DataGridColumnStyle boolCol = new DataGridBoolColumn();
    boolCol.set_MappingName("Current");
    boolCol.set_HeaderText("IsCurrent Customer");
    boolCol.set_Width(150);
    ts1.get_GridColumnStyles().Add(boolCol);

    // Add a second column style.
    DataGridColumnStyle textCol = new DataGridTextBoxColumn();
    textCol.set_MappingName("custName");
    textCol.set_HeaderText("Customer Name");
    textCol.set_Width(250);
    ts1.get_GridColumnStyles().Add(textCol);

    // Create the second table style with columns.
    DataGridTableStyle ts2 = new DataGridTableStyle();
    ts2.set_MappingName("Orders");
    // Change the colors.
    ts2.set_ForeColor(Color.get_Yellow());
    ts2.set_AlternatingBackColor(Color.get_Blue());
    ts2.set_BackColor(Color.get_Blue());

    // Create new DataGridColumnStyle objects.
    DataGridColumnStyle cOrderDate = new DataGridTextBoxColumn();
    cOrderDate.set_MappingName("OrderDate");
    cOrderDate.set_HeaderText("Order Date");
    cOrderDate.set_Width(100);
    ts2.get_GridColumnStyles().Add(cOrderDate);

    PropertyDescriptorCollection pcol = 
        this.get_BindingContext().
        get_Item(myDataSet, "Customers.custToOrders").
        GetItemProperties();
    DataGridColumnStyle csOrderAmount = 
        new DataGridTextBoxColumn(pcol.get_Item("OrderAmount"),
 "c", true);
    csOrderAmount.set_MappingName("OrderAmount");
    csOrderAmount.set_HeaderText("Total");
    csOrderAmount.set_Width(100);
    ts2.get_GridColumnStyles().Add(csOrderAmount);

    // Add the DataGridTableStyle objects to the collection.
    myDataGrid.get_TableStyles().Add(ts1);
    myDataGrid.get_TableStyles().Add(ts2);
} //AddCustomDataTableStyle
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
      System.Windows.Forms.DataGridTableStyle
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridTableStyle メンバ
System.Windows.Forms 名前空間
DataGrid クラス
DataGridColumnStyle クラス
GridColumnStylesCollection
GridTableStylesCollection

DataGridTableStyle コンストラクタ ()

DataGridTableStyle クラス新しインスタンス初期化します。

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

Dim instance As New DataGridTableStyle
public DataGridTableStyle ()
public:
DataGridTableStyle ()
public DataGridTableStyle ()
public function DataGridTableStyle ()
使用例使用例

新しDataGridTableStyle作成し、GridTableStylesCollection に追加するコード例次に示します

Private Sub AddGridTable()
   Dim myGridTableStyle As DataGridTableStyle
   myGridTableStyle = New DataGridTableStyle()
   myGridTableStyle.MappingName = "Customers"
   dataGrid1.TableStyles.Add(myGridTableStyle)
End Sub 
private void AddGridTable(){
   DataGridTableStyle myGridTableStyle;
   myGridTableStyle = new DataGridTableStyle();
   myGridTableStyle.MappingName = "Customers";
   dataGrid1.TableStyles.Add(myGridTableStyle);
}

private:
   void AddGridTable()
   {
      DataGridTableStyle^ myGridTableStyle;
      myGridTableStyle = gcnew DataGridTableStyle;
      myGridTableStyle->MappingName = "Customers";
      dataGrid1->TableStyles->Add( myGridTableStyle );
   }
private void AddGridTable()
{
    DataGridTableStyle myGridTableStyle;
    myGridTableStyle = new DataGridTableStyle();
    myGridTableStyle.set_MappingName("Customers");
    dataGrid1.get_TableStyles().Add(myGridTableStyle);
} //AddGridTable
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataGridTableStyle コンストラクタ (CurrencyManager)

CurrencyManager指定して、DataGridTableStyle クラス新しインスタンス初期化します。

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

Public Sub New ( _
    listManager As CurrencyManager _
)
Dim listManager As CurrencyManager

Dim instance As New DataGridTableStyle(listManager)
public DataGridTableStyle (
    CurrencyManager listManager
)
public:
DataGridTableStyle (
    CurrencyManager^ listManager
)
public DataGridTableStyle (
    CurrencyManager listManager
)
public function DataGridTableStyle (
    listManager : CurrencyManager
)

パラメータ

listManager

使用する CurrencyManager。

使用例使用例

DataTable の CurrencyManager使用して新しDataGridTableStyle作成するコード例次に示します

Private Sub CreateDataGridGridTableStyle()
   Dim myCurrencyManager As CurrencyManager
   Dim myGridTableStyle As DataGridTableStyle
   ' Get the CurrencyManager for a DataTable named "Customers"
   ' found in a DataSet named "myDataSet". 
   myCurrencyManager = CType _
   (Me.BindingContext(myDataSet, "Customers"),
 CurrencyManager)
   myGridTableStyle = New DataGridTableStyle(myCurrencyManager)
   ' Add the table style to the collection of a DataGrid.
   myDataGrid.TableStyles.Add(myGridTableStyle)
End Sub 'CreateDataGridGridTableStyle
private void CreateDataGridGridTableStyle(){
   CurrencyManager myCurrencyManager;
   DataGridTableStyle myGridTableStyle;
   /* Get the CurrencyManager for a DataTable named "Customers"
   found in a DataSet named "myDataSet". */
   myCurrencyManager = 
   (CurrencyManager) BindingContext[myDataSet, "Customers"];
   myGridTableStyle = new DataGridTableStyle(myCurrencyManager);
   // Add the table style to the collection of a DataGrid.
   myDataGrid.TableStyles.Add(myGridTableStyle);
}
 
private:
   void CreateDataGridGridTableStyle()
   {
      CurrencyManager^ myCurrencyManager;
      DataGridTableStyle^ myGridTableStyle;
      
      /* Get the CurrencyManager for a DataTable named "Customers"
         found in a DataSet named "myDataSet". */
      myCurrencyManager = dynamic_cast<CurrencyManager^>(BindingContext[myDataSet,
 "Customers"]);
      myGridTableStyle = gcnew DataGridTableStyle( myCurrencyManager );
      
      // Add the table style to the collection of a DataGrid.
      myDataGrid->TableStyles->Add( myGridTableStyle );
   }

private void CreateDataGridGridTableStyle()
{
    CurrencyManager myCurrencyManager;
    DataGridTableStyle myGridTableStyle;
    /*  Get the CurrencyManager for a DataTable named "Customers"
        found in a DataSet named "myDataSet". 
     */
    myCurrencyManager = 
        (CurrencyManager)( get_BindingContext().
        get_Item(myDataSet, "Customers"));
    myGridTableStyle = new DataGridTableStyle(myCurrencyManager);
    // Add the table style to the collection of a DataGrid.
    myDataGrid.get_TableStyles().Add(myGridTableStyle);
} //CreateDataGridGridTableStyle
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataGridTableStyle コンストラクタ (Boolean)

指定した値を使用して DataGridTableStyle クラス新しインスタンス初期化し、そのグリッド テーブル既定スタイルにするかどうか決定します

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

Public Sub New ( _
    isDefaultTableStyle As Boolean _
)
Dim isDefaultTableStyle As Boolean

Dim instance As New DataGridTableStyle(isDefaultTableStyle)
public DataGridTableStyle (
    bool isDefaultTableStyle
)
public:
DataGridTableStyle (
    bool isDefaultTableStyle
)
public DataGridTableStyle (
    boolean isDefaultTableStyle
)
public function DataGridTableStyle (
    isDefaultTableStyle : boolean
)

パラメータ

isDefaultTableStyle

テーブル既定として設定する場合trueそれ以外場合false

使用例使用例

新しDataGridTableStyle作成し、GridTableStylesCollection に追加するコード例次に示します

Private Sub AddGridTable()
   Dim myGridTableStyle As DataGridTableStyle
   myGridTableStyle = New DataGridTableStyle()
   myGridTableStyle.MappingName = "Customers"
   dataGrid1.TableStyles.Add(myGridTableStyle)
End Sub 
private void AddGridTable(){
   DataGridTableStyle myGridTableStyle;
   myGridTableStyle = new DataGridTableStyle();
   myGridTableStyle.MappingName = "Customers";
   dataGrid1.TableStyles.Add(myGridTableStyle);
}

private:
   void AddGridTable()
   {
      DataGridTableStyle^ myGridTableStyle;
      myGridTableStyle = gcnew DataGridTableStyle;
      myGridTableStyle->MappingName = "Customers";
      dataGrid1->TableStyles->Add( myGridTableStyle );
   }
private void AddGridTable()
{
    DataGridTableStyle myGridTableStyle;
    myGridTableStyle = new DataGridTableStyle();
    myGridTableStyle.set_MappingName("Customers");
    dataGrid1.get_TableStyles().Add(myGridTableStyle);
} //AddGridTable
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

DataGridTableStyle コンストラクタ

DataGridTableStyle クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
DataGridTableStyle () DataGridTableStyle クラス新しインスタンス初期化します。

.NET Compact Framework によってサポートされています。

DataGridTableStyle (Boolean) 指定した値を使用して DataGridTableStyle クラス新しインスタンス初期化し、そのグリッド テーブル既定スタイルにするかどうか決定します
DataGridTableStyle (CurrencyManager) CurrencyManager を指定してDataGridTableStyle クラス新しインスタンス初期化します。
参照参照

関連項目

DataGridTableStyle クラス
DataGridTableStyle メンバ
System.Windows.Forms 名前空間

DataGridTableStyle フィールド


パブリック フィールドパブリック フィールド

  名前 説明
パブリック フィールド DefaultTableStyle 既定テーブル スタイル取得します
参照参照

関連項目

DataGridTableStyle クラス
System.Windows.Forms 名前空間
DataGrid クラス
DataGridColumnStyle クラス
GridColumnStylesCollection
GridTableStylesCollection

DataGridTableStyle プロパティ


DataGridTableStyle メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド BeginEdit 編集操作要求します
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信使用するプロキシ生成必要な情報をすべて格納しているオブジェクト作成します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド Dispose オーバーロードされます。 DataGridTableStyle によって使用されているリソース解放します。
パブリック メソッド EndEdit 編集操作終了要求します
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetLifetimeService  対象インスタンス有効期間ポリシー制御する現在の有効期間サービス オブジェクト取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象インスタンス有効期間ポリシー制御する有効期間サービス オブジェクト取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ResetAlternatingBackColor AlternatingBackColor プロパティ既定値リセットします。
パブリック メソッド ResetBackColor BackColor プロパティ既定値リセットします。
パブリック メソッド ResetForeColor ForeColor プロパティ既定値リセットします。
パブリック メソッド ResetGridLineColor GridLineColor プロパティ既定値リセットします。
パブリック メソッド ResetHeaderBackColor HeaderBackColor プロパティ既定値リセットします。
パブリック メソッド ResetHeaderFont HeaderFont プロパティ既定値リセットします。
パブリック メソッド ResetHeaderForeColor HeaderForeColor プロパティ既定値リセットします。
パブリック メソッド ResetLinkColor LinkColor プロパティ既定値リセットします。
パブリック メソッド ResetLinkHoverColor LinkHoverColor プロパティ既定値リセットします。
パブリック メソッド ResetSelectionBackColor SelectionBackColor プロパティ既定値リセットします。
パブリック メソッド ResetSelectionForeColor SelectionForeColor プロパティ既定値リセットします。
パブリック メソッド ToString  Component の名前を格納している String返します (存在する場合)。このメソッドオーバーライドできません。 ( Component から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CreateGridColumn オーバーロードされます。 DataGridColumnStyle を作成します
プロテクト メソッド Dispose オーバーロードされますオーバーライドされますDataGridTableStyle によって使用されているリソース解放します。
プロテクト メソッド Finalize  Componentガベージ コレクションによってクリアされる前に、アンマネージ リソース解放しその他のクリーンアップ操作実行します。 ( Component から継承されます。)
プロテクト メソッド GetService  Component またはその Container提供されるサービスを表すオブジェクト返します。 ( Component から継承されます。)
プロテクト メソッド MemberwiseClone  オーバーロードされます。 ( MarshalByRefObject から継承されます。)
プロテクト メソッド OnAllowSortingChanged AllowSortingChanged イベント発生させます
プロテクト メソッド OnAlternatingBackColorChanged AlternatingBackColorChanged イベント発生させます
プロテクト メソッド OnBackColorChanged BackColorChanged イベント発生させます
プロテクト メソッド OnColumnHeadersVisibleChanged ColumnHeadersVisibleChanged イベント発生させます
プロテクト メソッド OnForeColorChanged ForeColorChanged イベント発生させます
プロテクト メソッド OnGridLineColorChanged GridLineColorChanged イベント発生させます
プロテクト メソッド OnGridLineStyleChanged GridLineStyleChanged イベント発生させます
プロテクト メソッド OnHeaderBackColorChanged HeaderBackColorChanged イベント発生させます
プロテクト メソッド OnHeaderFontChanged HeaderFontChanged イベント発生させます
プロテクト メソッド OnHeaderForeColorChanged HeaderForeColorChanged イベント発生させます
プロテクト メソッド OnLinkColorChanged LinkColorChanged イベント発生させます
プロテクト メソッド OnLinkHoverColorChanged LinkHoverColorChanged イベント発生させます
プロテクト メソッド OnMappingNameChanged MappingNameChanged イベント発生させます
プロテクト メソッド OnPreferredColumnWidthChanged PreferredColumnWidthChanged イベント発生させます
プロテクト メソッド OnPreferredRowHeightChanged PreferredRowHeightChanged イベント発生させます
プロテクト メソッド OnReadOnlyChanged ReadOnlyChanged イベント発生させます
プロテクト メソッド OnRowHeadersVisibleChanged RowHeadersVisibleChanged イベント発生させます
プロテクト メソッド OnRowHeaderWidthChanged RowHeaderWidthChanged イベント発生させます
プロテクト メソッド OnSelectionBackColorChanged SelectionBackColorChanged イベント発生させます
プロテクト メソッド OnSelectionForeColorChanged SelectionForeColorChanged イベント発生させます
プロテクト メソッド ShouldSerializeAlternatingBackColor AlternatingBackColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeBackColor BackColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeForeColor ForeColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeGridLineColor GridLineColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeHeaderBackColor HeaderBackColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeHeaderForeColor HeaderForeColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeLinkColor LinkColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeLinkHoverColor LinkHoverColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializePreferredRowHeight PreferredRowHeight プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeSelectionBackColor SelectionBackColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeSelectionForeColor SelectionForeColor プロパティ永続化する必要があるかどうか示します
参照参照

関連項目

DataGridTableStyle クラス
System.Windows.Forms 名前空間
DataGrid クラス
DataGridColumnStyle クラス
GridColumnStylesCollection
GridTableStylesCollection

DataGridTableStyle メンバ

System.Windows.Forms.DataGrid コントロールによって実行時描画されるテーブル表します

DataGridTableStyle データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド DataGridTableStyle オーバーロードされます。 DataGridTableStyle クラス新しインスタンス初期化します。
パブリック フィールドパブリック フィールド
  名前 説明
パブリック フィールド DefaultTableStyle 既定テーブル スタイル取得します
パブリック プロパティパブリック プロパティ
プロテクト プロパティプロテクト プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド BeginEdit 編集操作要求します
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信使用するプロキシ生成必要な情報をすべて格納しているオブジェクト作成します。 (MarshalByRefObject から継承されます。)
パブリック メソッド Dispose オーバーロードされますDataGridTableStyle によって使用されているリソース解放します。
パブリック メソッド EndEdit 編集操作終了要求します
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetLifetimeService  対象インスタンス有効期間ポリシー制御する現在の有効期間サービス オブジェクト取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象インスタンス有効期間ポリシー制御する有効期間サービス オブジェクト取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ResetAlternatingBackColor AlternatingBackColor プロパティ既定値リセットします。
パブリック メソッド ResetBackColor BackColor プロパティ既定値リセットします。
パブリック メソッド ResetForeColor ForeColor プロパティ既定値リセットします。
パブリック メソッド ResetGridLineColor GridLineColor プロパティ既定値リセットします。
パブリック メソッド ResetHeaderBackColor HeaderBackColor プロパティ既定値リセットします。
パブリック メソッド ResetHeaderFont HeaderFont プロパティ既定値リセットします。
パブリック メソッド ResetHeaderForeColor HeaderForeColor プロパティ既定値リセットします。
パブリック メソッド ResetLinkColor LinkColor プロパティ既定値リセットします。
パブリック メソッド ResetLinkHoverColor LinkHoverColor プロパティ既定値リセットします。
パブリック メソッド ResetSelectionBackColor SelectionBackColor プロパティ既定値リセットします。
パブリック メソッド ResetSelectionForeColor SelectionForeColor プロパティ既定値リセットします。
パブリック メソッド ToString  Component の名前を格納している String返します (存在する場合)。このメソッドオーバーライドできません。 (Component から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CreateGridColumn オーバーロードされます。 DataGridColumnStyle を作成します
プロテクト メソッド Dispose オーバーロードされますオーバーライドされますDataGridTableStyle によって使用されているリソース解放します。
プロテクト メソッド Finalize  Componentガベージ コレクションによってクリアされる前に、アンマネージ リソース解放しその他のクリーンアップ操作実行します。 (Component から継承されます。)
プロテクト メソッド GetService  Component またはその Container提供されるサービスを表すオブジェクト返します。 (Component から継承されます。)
プロテクト メソッド MemberwiseClone  オーバーロードされます。 ( MarshalByRefObject から継承されます。)
プロテクト メソッド OnAllowSortingChanged AllowSortingChanged イベント発生させます
プロテクト メソッド OnAlternatingBackColorChanged AlternatingBackColorChanged イベント発生させます
プロテクト メソッド OnBackColorChanged BackColorChanged イベント発生させます
プロテクト メソッド OnColumnHeadersVisibleChanged ColumnHeadersVisibleChanged イベント発生させます
プロテクト メソッド OnForeColorChanged ForeColorChanged イベント発生させます
プロテクト メソッド OnGridLineColorChanged GridLineColorChanged イベント発生させます
プロテクト メソッド OnGridLineStyleChanged GridLineStyleChanged イベント発生させます
プロテクト メソッド OnHeaderBackColorChanged HeaderBackColorChanged イベント発生させます
プロテクト メソッド OnHeaderFontChanged HeaderFontChanged イベント発生させます
プロテクト メソッド OnHeaderForeColorChanged HeaderForeColorChanged イベント発生させます
プロテクト メソッド OnLinkColorChanged LinkColorChanged イベント発生させます
プロテクト メソッド OnLinkHoverColorChanged LinkHoverColorChanged イベント発生させます
プロテクト メソッド OnMappingNameChanged MappingNameChanged イベント発生させます
プロテクト メソッド OnPreferredColumnWidthChanged PreferredColumnWidthChanged イベント発生させます
プロテクト メソッド OnPreferredRowHeightChanged PreferredRowHeightChanged イベント発生させます
プロテクト メソッド OnReadOnlyChanged ReadOnlyChanged イベント発生させます
プロテクト メソッド OnRowHeadersVisibleChanged RowHeadersVisibleChanged イベント発生させます
プロテクト メソッド OnRowHeaderWidthChanged RowHeaderWidthChanged イベント発生させます
プロテクト メソッド OnSelectionBackColorChanged SelectionBackColorChanged イベント発生させます
プロテクト メソッド OnSelectionForeColorChanged SelectionForeColorChanged イベント発生させます
プロテクト メソッド ShouldSerializeAlternatingBackColor AlternatingBackColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeBackColor BackColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeForeColor ForeColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeGridLineColor GridLineColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeHeaderBackColor HeaderBackColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeHeaderForeColor HeaderForeColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeLinkColor LinkColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeLinkHoverColor LinkHoverColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializePreferredRowHeight PreferredRowHeight プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeSelectionBackColor SelectionBackColor プロパティ永続化する必要があるかどうか示します
プロテクト メソッド ShouldSerializeSelectionForeColor SelectionForeColor プロパティ永続化する必要があるかどうか示します
パブリック イベントパブリック イベント
  名前 説明
パブリック イベント Disposed  コンポーネントDisposed イベント待機するイベント ハンドラ追加します。(Component から継承されます。)
パブリック イベント ForeColorChanged ForeColor の値が変更され場合発生します
パブリック イベント GridLineColorChanged GridLineColor の値が変更され場合発生します
パブリック イベント GridLineStyleChanged GridLineStyle の値が変更され場合発生します
パブリック イベント HeaderBackColorChanged HeaderBackColor の値が変更され場合発生します
パブリック イベント HeaderFontChanged HeaderFont の値が変更され場合発生します
パブリック イベント HeaderForeColorChanged HeaderForeColor の値が変更され場合発生します
パブリック イベント LinkColorChanged LinkColor の値が変更され場合発生します
パブリック イベント LinkHoverColorChanged LinkHoverColor の値が変更され場合発生します
パブリック イベント MappingNameChanged MappingName の値が変更され場合発生します
パブリック イベント PreferredColumnWidthChanged PreferredColumnWidth プロパティの値が変更され場合発生します
パブリック イベント PreferredRowHeightChanged PreferredRowHeight の値が変更され場合発生します
パブリック イベント ReadOnlyChanged ReadOnly の値が変更され場合発生します
パブリック イベント RowHeadersVisibleChanged RowHeadersVisible の値が変更され場合発生します
パブリック イベント RowHeaderWidthChanged RowHeaderWidth の値が変更され場合発生します
パブリック イベント SelectionBackColorChanged SelectionBackColor の値が変更され場合発生します
パブリック イベント SelectionForeColorChanged SelectionForeColor の値が変更され場合発生します
参照参照

関連項目

DataGridTableStyle クラス
System.Windows.Forms 名前空間
DataGrid クラス
DataGridColumnStyle クラス
GridColumnStylesCollection
GridTableStylesCollection



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

辞書ショートカット

すべての辞書の索引

「DataGridTableStyle」の関連用語

DataGridTableStyleのお隣キーワード
検索ランキング

   

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



DataGridTableStyleのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS