本文整理匯總了VB.NET中System.Web.UI.Design.WebControls.ListControlDataBindingHandler類的典型用法代碼示例。如果您正苦於以下問題:VB.NET ListControlDataBindingHandler類的具體用法?VB.NET ListControlDataBindingHandler怎麽用?VB.NET ListControlDataBindingHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ListControlDataBindingHandler類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1:
' 導入命名空間
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.ComponentModel
Imports System.Security.Permissions
Namespace Examples.VB.WebControls.Design
' The SimpleRadioButtonList is a copy of the RadioButtonList.
' It uses the SimpleRadioButtonListDesigner for design-time support.
<AspNetHostingPermission(SecurityAction.Demand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
Level:=AspNetHostingPermissionLevel.Minimal)> _
<DesignerAttribute(GetType(Examples.VB.WebControls.Design. _
SimpleRadioButtonListDesigner))> _
<DataBindingHandler(GetType(Examples.VB.WebControls.Design. _
SimpleRadioButtonListDataBindingHandler))> _
Public Class SimpleRadioButtonList
Inherits RadioButtonList
End Class
End Namespace ' Examples.VB.WebControls.Design
示例2: DataBindControl
' Imports System.Design
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Web.UI
Imports System.Web.UI.Design.WebControls
Namespace Examples.VB.WebControls.Design
' Derive the SimpleRadioButtonListDataBindingHandler.
Public Class SimpleRadioButtonListDataBindingHandler
Inherits ListControlDataBindingHandler
' Override the DataBindControl.
Public Overrides Sub DataBindControl( _
ByVal designerHost As IDesignerHost, _
ByVal control As Control)
' Create a reference, named dataSourceBinding,
' to the control's DataSource binding.
Dim dataSourceBinding As DataBinding _
= CType( _
control, _
IDataBindingsAccessor).DataBindings("DataSource")
' If the binding exists, create a reference to the
' list control, clear its ListItemCollection, and then add
' an item to the collection.
If Not (dataSourceBinding Is Nothing) Then
Dim simpleControl As SimpleRadioButtonList = _
CType(control, SimpleRadioButtonList)
simpleControl.Items.Clear()
simpleControl.Items.Add("Data-bound Radio Button.")
End If
End Sub
End Class
End Namespace ' Examples.VB.WebControls.Design