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

仅当 DataGrid 包含至少一 DataRelation 到一秒 DataTable时,并且属性 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
Windows Desktop 3.0

另请参阅