DataGridParentRowsLabelStyle Enum

Definition

Varning

DataGrid is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use DataGridView instead.

Anger hur de överordnade radetiketterna för en DataGrid kontroll visas.

public enum class DataGridParentRowsLabelStyle
public enum DataGridParentRowsLabelStyle
[System.ComponentModel.Browsable(false)]
[System.Obsolete("`DataGrid` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `DataGridView` instead.", false, DiagnosticId="WFDEV006", UrlFormat="https://aka.ms/winforms-warnings/{0}")]
public enum DataGridParentRowsLabelStyle
type DataGridParentRowsLabelStyle = 
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("`DataGrid` is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use `DataGridView` instead.", false, DiagnosticId="WFDEV006", UrlFormat="https://aka.ms/winforms-warnings/{0}")>]
type DataGridParentRowsLabelStyle = 
Public Enum DataGridParentRowsLabelStyle
Arv
DataGridParentRowsLabelStyle
Attribut

Fält

Name Värde Description
None 0

Visa inga överordnade radetiketter.

TableName 1

Visar det överordnade tabellnamnet.

ColumnName 2

Visar det överordnade kolumnnamnet.

Both 3

Visar både den överordnade tabellen och kolumnnamnen.

Exempel

Följande exempel itererar genom var och en av de möjliga värdena för 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

Kommentarer

Använd medlemmarna i den här uppräkningen för att ange värdet för ParentRowsLabelStyle egenskapen.

Överordnade rader kan endast visas om innehåller DataGrid minst en DataRelation till en sekund DataTableoch om AllowNavigation egenskapen är inställd på ett värde som tillåter navigering.

Gäller för

Se även