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 至少包含一个与另一个 DataTableDataRelation,并且 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

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

System.Windows.Forms 命名空间
DataGrid 类
DataTable
DataRelation
DataGrid.ParentRowsForeColor 属性
DataGrid.ParentRowsBackColor 属性
DataGrid.ParentRowsLabelStyle 属性
DataGrid.ParentRowsVisible 属性
DataGrid.AllowNavigation 属性