DataGridParentRowsLabelStyle Enum
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Perhatian
DataGrid is provided for binary compatibility with .NET Framework and is not intended to be used directly from your code. Use DataGridView instead.
Menentukan bagaimana label baris induk kontrol DataGrid ditampilkan.
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
- Warisan
- Atribut
Bidang
| Nama | Nilai | Deskripsi |
|---|---|---|
| None | 0 | Tidak menampilkan label baris induk. |
| TableName | 1 | Menampilkan nama tabel induk. |
| ColumnName | 2 | Menampilkan nama kolom induk. |
| Both | 3 | Menampilkan nama tabel dan kolom induk. |
Contoh
Contoh berikut berulang melalui setiap nilai yang mungkin untuk 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
Keterangan
Gunakan anggota enumerasi ini untuk mengatur nilai ParentRowsLabelStyle properti.
Baris induk hanya dapat ditampilkan jika DataGrid berisi setidaknya satu DataRelation hingga satu detik DataTable, dan jika AllowNavigation properti diatur ke nilai yang memungkinkan navigasi.