vb System.Web.UI.Design.WebControls.ListControlDataBindingHandler.DataBindControl类(方法)实例源码

下面列出了vb System.Web.UI.Design.WebControls.ListControlDataBindingHandler.DataBindControl 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Web.UI.Design.WebControl   
' 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


问题


面经


文章

微信
公众号

扫码关注公众号