英語で読む

次の方法で共有


DataGridParentRowsLabelStyle 列挙型

定義

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

C#
public enum DataGridParentRowsLabelStyle
継承
DataGridParentRowsLabelStyle

フィールド

名前 説明
Both 3

親テーブル名と列名の両方を表示します。

ColumnName 2

親列名を表示します。

None 0

親行ラベルは表示しません。

TableName 1

親テーブル名を表示します。

次の例では、 に対して使用可能な各値を反復処理します DataGridParentRowsLabelStyle

VB
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

注釈

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

親行は、 に少なくとも 1 から DataRelation 2 番目DataTableの が含まれている場合DataGrid、および プロパティがナビゲーションを許可する値に設定されている場合AllowNavigationにのみ表示できます。

適用対象

製品 バージョン
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0

こちらもご覧ください