DataGridDesigner.GetErrorDesignTimeHtml(Exception) Metod

Definition

Hämtar HTML-koden som visas vid designtillfället för det angivna undantaget när ett fel har påträffats när kontrollen återges.

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

Parametrar

e
Exception

Undantaget som inträffade.

Returer

HTML-markering som visas vid designtillfället för det angivna undantaget.

Exempel

I följande kodexempel visas hur du åsidosätter GetErrorDesignTimeHtml metoden för att ändra kontrollens DataGrid utseende på designytan när ett undantag inträffar.

Det här kodexemplet är en del av ett större exempel för DataGridDesigner klassen.

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

Gäller för

Se även