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 值之一。默认为 Both。
异常
异常类型 | 条件 |
---|---|
枚举数无效。 |
示例
下面的代码示例在 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
平台
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
请参见
参考
DataGrid 类
DataGrid 成员
System.Windows.Forms 命名空间
DataGrid.AllowNavigation 属性
DataGrid.ParentRowsForeColor 属性
DataGrid.ParentRowsBackColor 属性
ParentRowsVisible