DataGridViewRow.Visible Properti
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.
Mendapatkan atau menetapkan nilai yang menunjukkan apakah baris terlihat.
public:
virtual property bool Visible { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(false)]
public override bool Visible { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.Visible : bool with get, set
Public Overrides Property Visible As Boolean
Nilai Properti
true jika baris terlihat; jika tidak, false.
- Atribut
Pengecualian
Baris berada dalam DataGridView kontrol dan merupakan baris bersama.
Contoh
Contoh kode berikut menunjukkan cara menggunakan DataGridViewBand.Visible properti , yang hampir identik Visible dengan properti DataGridViewRow kelas . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk DataGridViewBand kelas .
// Hide a band of cells.
void Button6_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
DataGridViewBand^ band = dataGridView->Rows[ 3 ];
band->Visible = false;
}
// Hide a band of cells.
private void Button6_Click(object sender, System.EventArgs e)
{
DataGridViewBand band = dataGridView.Rows[3];
band.Visible = false;
}
' Hide a band of cells.
Private Sub Button6_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Button6.Click
Dim band As DataGridViewBand = dataGridView.Rows(3)
band.Visible = False
End Sub
Keterangan
Gunakan properti ini untuk menyembunyikan baris dari tampilan sambil mempertahankan baris di DataGridView. Untuk menghapus baris sepenuhnya, gunakan DataGridViewRowCollection.Remove metode .