DataGridDesigner.GetErrorDesignTimeHtml(Exception) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取呈现控件时遇到错误时在设计时显示的指定异常的 HTML 标记。
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
参数
发生的异常。
返回
在设计时显示的指定异常的 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