DataGrid.ParentRowsLabelStyleとは? わかりやすく解説

DataGrid.ParentRowsLabelStyle プロパティ

親行ラベルの表示方法を取得または設定します。

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

Public Property ParentRowsLabelStyle As
 DataGridParentRowsLabelStyle
Dim instance As DataGrid
Dim value As DataGridParentRowsLabelStyle

value = instance.ParentRowsLabelStyle

instance.ParentRowsLabelStyle = value
public DataGridParentRowsLabelStyle ParentRowsLabelStyle { get;
 set; }
public:
property DataGridParentRowsLabelStyle ParentRowsLabelStyle {
    DataGridParentRowsLabelStyle get ();
    void set (DataGridParentRowsLabelStyle
 value);
}
/** @property */
public DataGridParentRowsLabelStyle get_ParentRowsLabelStyle ()

/** @property */
public void set_ParentRowsLabelStyle (DataGridParentRowsLabelStyle
 value)
public function get ParentRowsLabelStyle
 () : DataGridParentRowsLabelStyle

public function set ParentRowsLabelStyle
 (value : DataGridParentRowsLabelStyle)

プロパティ値
DataGridParentRowsLabelStyle 値の 1 つ。既定値は Both です。

例外例外
例外の種類条件

InvalidEnumArgumentException

列挙子が有効ではありませんでした。

使用例使用例

ParentRowsLabelStyle プロパティに指定できる値の循環処理を設定するコード例を次に示します。

Private Sub ChangeParentRowLabels(ByVal
 myGrid As DataGrid)
    Static currentLabelStyle As Integer
    If currentLabelStyle = 4 Then currentLabelStyle
 = 0
    Select Case currentLabelStyle
    Case 0 
       myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.None
    Case 1
       myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.TableName
    Case 2
       myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.ColumnName
    Case 3
       myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.Both
    Case Else
       myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.Both
    End Select
 End Sub
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGrid クラス
DataGrid メンバ
System.Windows.Forms 名前空間
DataGrid.AllowNavigation プロパティ
DataGrid.ParentRowsForeColor プロパティ
DataGrid.ParentRowsBackColor プロパティ
ParentRowsVisible

DataGridParentRowsLabelStyle 列挙体

DataGrid コントロールの親行ラベルの表示方法を指定します。

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

Public Enumeration DataGridParentRowsLabelStyle
Dim instance As DataGridParentRowsLabelStyle
public enum DataGridParentRowsLabelStyle
public enum class DataGridParentRowsLabelStyle
public enum DataGridParentRowsLabelStyle
public enum DataGridParentRowsLabelStyle
メンバメンバ
 メンバ名説明
Both親テーブル名と列名の両方を表示します。 
ColumnName親列名を表示します。 
None親行ラベルは表示しません。 
TableName親テーブル名を表示します。 
解説解説

この列挙体のメンバを使用して、ParentRowsLabelStyle プロパティの値を設定します。

DataGrid に第 2 の DataTable への DataRelation が少なくとも 1 つある場合や、AllowNavigation プロパティが移動を許可する値に設定されている場合だけ、親行が表示されます。

使用例使用例

DataGridParentRowsLabelStyle に指定できる値を反復処理する例を次に示します。

Private Sub ChangeParentRowLabels(ByVal
 myGrid As DataGrid)
   Static currentLabelStyle As Integer
   If currentLabelStyle = 4 Then currentLabelStyle
 = 0
   Select Case currentLabelStyle
   Case 0 
      myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.None
   Case 1
      myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.TableName
   Case 2
      myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.ColumnName
   Case 3
      myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.Both
   Case Else
      myGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.Both
   End Select

   ' Increment the variable.
   currentLabelStyle+=1
End Sub
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Windows.Forms 名前空間
DataGrid クラス
DataTable
DataRelation
DataGrid.ParentRowsForeColor プロパティ
DataGrid.ParentRowsBackColor プロパティ
DataGrid.ParentRowsLabelStyle プロパティ
DataGrid.ParentRowsVisible プロパティ
DataGrid.AllowNavigation プロパティ



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「DataGrid.ParentRowsLabelStyle」の関連用語

DataGrid.ParentRowsLabelStyleのお隣キーワード
検索ランキング

   

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



DataGrid.ParentRowsLabelStyleのページの著作権

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

©2026 GRAS Group, Inc.RSS