本文整理汇总了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