This documentation is archived and is not being maintained.

ListControlDataBindingHandler Class

Provides a data-binding handler for a ListControl.

For a list of all members of this type, see ListControlDataBindingHandler Members.


[Visual Basic]
Public Class ListControlDataBindingHandler
   Inherits DataBindingHandler
public class ListControlDataBindingHandler : DataBindingHandler
public __gc class ListControlDataBindingHandler : public
public class ListControlDataBindingHandler extends

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


[Visual Basic] The following code example creates a class named SimpleRadioButtonListDataBindingHandler that inherits from the ListControlDataBindingHandler class. It overrides the DataBindControl method to add a custom string to the SimpleRadioButtonList class when the control is data bound.

[Visual Basic] 
Imports System.Design
Imports System
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Reflection
Imports System.Web.UI
Imports System.Web.UI.Design.WebControls
Imports Examples.AspNet

Namespace Examples.AspNet.Design
    ' Declare the SimpleRadioButtonListDataBindingHandler class.
    <System.Security.Permissions.SecurityPermission( _
        System.Security.Permissions.SecurityAction.Demand, _
        Flags := System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)>  _
    Public Class SimpleRadioButtonListDataBindingHandler
        Inherits ListControlDataBindingHandler

        ' Override the DataBindControl method.
        Public Overrides Sub DataBindControl( _
            designerHost As IDesignerHost, _
            control As Control)
            ' Create a reference, named dataSourceBinding,
            ' to the control's DataSource binding.
            Dim dataSourceBinding As DataBinding  _
                = CType( _
                control, _

            ' If the binding exists, create a reference to the
            ' list control, clear its ListItemCollection, then add
            ' an item to the collection.
            If Not (dataSourceBinding Is Nothing) Then
               Dim simpleControl As SimpleRadioButtonList = _
                   CType(control, SimpleRadioButtonList)
               simpleControl.Items.Add("Data-bound Radio Button.")
            End If
        End Sub
    End Class
End Namespace

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.


Namespace: System.Web.UI.Design.WebControls

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

Assembly: System.Design (in System.Design.dll)

See Also

ListControlDataBindingHandler Members | System.Web.UI.Design.WebControls Namespace