DataGridParentRowsLabelStyle Enumeráció

Definíció

Figyelemfelhívás

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

Meghatározza, hogy miként jelenjenek meg egy DataGrid vezérlőelem szülősorfeliratai.

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
Öröklődés
DataGridParentRowsLabelStyle
Attribútumok

Mezők

Name Érték Description
None 0

Ne jelenjenek meg szülősorfeliratok.

TableName 1

Megjeleníti a szülőtábla nevét.

ColumnName 2

Megjeleníti a szülőoszlop nevét.

Both 3

Megjeleníti a szülőtábla és az oszlop nevét is.

Példák

Az alábbi példa végigvezeti a lehetséges értékeken a 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

Megjegyzések

A számbavétel tagjaival állítsa be a ParentRowsLabelStyle tulajdonság értékét.

A szülősorok csak akkor jeleníthetők meg, ha az DataGrid tartalmaz legalább egy-egy DataRelation másodpercet DataTable, és ha a AllowNavigation tulajdonság olyan értékre van beállítva, amely lehetővé teszi a navigációt.

A következőre érvényes:

Lásd még