DataGridParentRowsLabelStyle 枚举
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定 DataGrid 控件的父行标签的显示方式。
public enum class DataGridParentRowsLabelStyle
C#
public enum DataGridParentRowsLabelStyle
type DataGridParentRowsLabelStyle =
Public Enum 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 |