DataGridParentRowsLabelStyle Enumeração
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Cuidado
DataGrid is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use DataGridView instead.
Especifica como os rótulos de linha pai de um controle DataGrid são exibidos.
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
- Herança
- Atributos
Campos
| Nome | Valor | Description |
|---|---|---|
| None | 0 | Não exibir rótulos de linha pai. |
| TableName | 1 | Exibe o nome da tabela pai. |
| ColumnName | 2 | Exibe o nome da coluna pai. |
| Both | 3 | Exibe os nomes da tabela pai e da coluna. |
Exemplos
O exemplo a seguir itera por meio de cada um dos valores possíveis para o 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
Comentários
Use os membros dessa enumeração para definir o valor da ParentRowsLabelStyle propriedade.
As linhas pai só poderão ser exibidas se elas DataGrid contiverem pelo menos um DataRelation a um segundo DataTablee se a AllowNavigation propriedade estiver definida como um valor que permita a navegação.