本文整理匯總了VB.NET中System.Web.UI.Design.WebControls.DataListDesigner類的典型用法代碼示例。如果您正苦於以下問題:VB.NET DataListDesigner類的具體用法?VB.NET DataListDesigner怎麽用?VB.NET DataListDesigner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了DataListDesigner類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Initialize
' 導入命名空間
Imports System.Drawing
Imports System.ComponentModel
Imports System.Web.UI.WebControls
Imports System.Security
Imports System.Web.UI.Design
Imports System.Web.UI.Design.WebControls
Namespace ASPNET.Examples
< _
Designer("ASPNET.Examples.Design.SimpleGridViewDesigner", _
"System.Web.UI.Design.GridViewDesigner") _
> _
Public Class SimpleGridView
Inherits GridView
' Code to customize your GridView goes here
End Class
End Namespace
Namespace ASPNET.Examples.Design
<Permissions.SecurityPermission( _
Permissions.SecurityAction.Demand, _
Flags:=Permissions.SecurityPermissionFlag.UnmanagedCode)> _
Public Class SimpleGridViewDesigner
Inherits GridViewDesigner
Private simpleGView As SimpleGridView
Public Overrides Function GetDesignTimeHtml() As String
Dim designTimeHtml As String = String.Empty
simpleGView = CType(Component, SimpleGridView)
' Check the control's BorderStyle property to
' conditionally render design-time HTML.
If (simpleGView.BorderStyle = BorderStyle.NotSet) Then
' Save the current property settings in variables.
Dim oldCellPadding As Integer = simpleGView.CellPadding
Dim oldBorderWidth As Unit = simpleGView.BorderWidth
Dim oldBorderColor As Color = simpleGView.BorderColor
' Set properties and generate the design-time HTML.
Try
simpleGView.Caption = "SimpleGridView"
simpleGView.CellPadding = 1
simpleGView.BorderWidth = Unit.Pixel(3)
simpleGView.BorderColor = Color.Red
designTimeHtml = MyBase.GetDesignTimeHtml()
Catch ex As Exception
' Get HTML from the GetErrorDesignTimeHtml
' method if an exception occurs.
designTimeHtml = GetErrorDesignTimeHtml(ex)
' Return the properties to their original values.
Finally
simpleGView.CellPadding = oldCellPadding
simpleGView.BorderWidth = oldBorderWidth
simpleGView.BorderColor = oldBorderColor
End Try
Else
designTimeHtml = MyBase.GetDesignTimeHtml()
End If
Return designTimeHtml
End Function
Protected Overrides Function _
GetErrorDesignTimeHtml(ByVal exc As Exception) As String
Return CreatePlaceHolderDesignTimeHtml( _
"ASPNET.Examples: An error occurred while rendering the GridView.")
End Function
Public Overrides Sub Initialize(ByVal component As IComponent)
simpleGView = CType(component, SimpleGridView)
MyBase.Initialize(component)
End Sub
End Class
End Namespace
示例2: Designer
< _
Designer("ASPNET.Examples.Design.SimpleGridViewDesigner", _
"System.Web.UI.Design.GridViewDesigner") _
> _
Public Class SimpleGridView
Inherits GridView
' Code to customize your GridView goes here
End Class