property List.UnboundHandler as IUnboundHandler
Specifies the control's unbound handler.

 TypeDescription 
   IUnboundHandler An object that implements IUnboundHandler notification interface  
The control supports unbound mode. In unbound mode, user is responsible for retrieving items. In order to let the control works in unbound mode, the user has to implement the  IUnboundHandler notification interface. Use the VirtualMode property to run the control in virtual mode. Use the RemoveAll method to remove all items from the control, after setting the UnboundHandler property to nothing.  Use the BeginUpdate and EndUpdate methods, or Refresh method after setting the UnboundHandler property, to reflect the changes in the control's client area.

If the VirtualMode property is True and the DataSource property is set ( not empty ), the control provides an internal object that implements the IUnboundHandler interface to provide data for the control from the data source.

The following VB sample shows how to activate the control's unbound mode

Implements IUnboundHandler
Dim its As Items

Private Property Get IUnboundHandler_ItemsCount(ByVal Source As Object) As Long
    IUnboundHandler_ItemsCount = 150000
End Property

Private Sub IUnboundHandler_ReadItem(ByVal Index As Long, ByVal Source As Object)
    its.Caption(Index, 0) = Index
    its.CellImage(Index, 0) = Index Mod 2 + 1
End Sub

Private Sub Form_Load()
    With List1
        .ColumnAutoResize = True
        .SortOnClick = False
        .MarkSearchColumn = False
        .Columns.Add "Unbound Column"

        Set its = .Items
        Set .UnboundHandler = Me

    End With
End Sub


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.