Partager via


DataGridParentRowsLabelStyle Énumération

Définition

Attention

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

Spécifie comment les étiquettes de ligne parentes d’un contrôle DataGrid sont affichées.

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
Héritage
DataGridParentRowsLabelStyle
Attributs

Champs

Nom Valeur Description
None 0

Afficher aucune étiquette de ligne parente.

TableName 1

Affiche le nom de la table parente.

ColumnName 2

Affiche le nom de la colonne parente.

Both 3

Affiche les noms des tables et des colonnes parentes.

Exemples

L’exemple suivant itère à travers chacune des valeurs possibles pour le 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

Remarques

Utilisez les membres de cette énumération pour définir la valeur de la ParentRowsLabelStyle propriété.

Les lignes parentes ne peuvent être affichées que si le DataGrid contenu contient au moins un DataRelation à une seconde DataTable, et si la propriété est définie sur une valeur qui autorise la AllowNavigation navigation.

S’applique à

Voir aussi