Bagikan melalui


DataGridDesigner.GetErrorDesignTimeHtml(Exception) Metode

Definisi

Mendapatkan markup HTML yang ditampilkan pada waktu desain untuk pengecualian yang ditentukan ketika terjadi kesalahan saat merender kontrol.

protected:
 override System::String ^ GetErrorDesignTimeHtml(Exception ^ e);
protected override string GetErrorDesignTimeHtml (Exception e);
override this.GetErrorDesignTimeHtml : Exception -> string
Protected Overrides Function GetErrorDesignTimeHtml (e As Exception) As String

Parameter

e
Exception

Pengecualian yang terjadi.

Mengembalikan

Markup HTML ditampilkan pada waktu desain untuk pengecualian yang ditentukan.

Contoh

Contoh kode berikut menunjukkan cara mengambil GetErrorDesignTimeHtml alih metode untuk memodifikasi tampilan DataGrid kontrol pada permukaan desain ketika pengecualian terjadi.

Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk DataGridDesigner kelas .

Protected Overrides Function GetEmptyDesignTimeHtml() As String
    Dim emptyText As String

    ' Check the CanEnterTemplateMode property to
    ' specify which text to display if ItemTemplate 
    ' does not contain a value.
    If CanEnterTemplateMode Then
        emptyText = _
            "<b>Either the Enabled property value is false " + _
            "or you need to set the ItemTemplate for this " + _
            "control.<br>Right-click to edit templates.</b>"
    Else
        emptyText = _
            "<b>You cannot edit templates in this view.<br>" + _
            "Switch to HTML view to define the ItemTemplate.</b>"
    End If

    Return CreatePlaceHolderDesignTimeHtml(emptyText)
End Function

Berlaku untuk

Lihat juga