DataGridDesigner.GetErrorDesignTimeHtml(Exception) 方法       
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在呈现控件时遇到错误后获取设计时为指定的异常显示的 HTML 标记。
protected:
 override System::String ^ GetErrorDesignTimeHtml(Exception ^ e);protected override string GetErrorDesignTimeHtml (Exception e);override this.GetErrorDesignTimeHtml : Exception -> stringProtected Overrides Function GetErrorDesignTimeHtml (e As Exception) As String参数
发生的异常。
返回
设计时为指定的异常显示的 HTML 标记。
示例
下面的代码示例演示如何重写 方法, GetErrorDesignTimeHtml 以在发生异常时修改控件在设计图面上的外观 DataGrid 。
此代码示例是为 DataGridDesigner 类提供的一个更大示例的一部分。
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