Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Item Property, VirtualItem Object

Returns the SftTreeItem object of the item currently requested from the virtual data source.

Syntax

Get

VB.NETrefItemObj = object.Item As SftTreeItem
VBSet refItemObj = object.Item As SftTreeItem
C#.NETSftTreeItem refItemObj = object;
VC++ISftTreeItem* refItemObj = object->Item;
ISftTreeItem* refItemObj = object->GetItem();
CHRESULT object->get_Item(ISftTreeItem** refItemObj);

object

A VirtualItem object.

refItemObj

Returns the SftTreeItem object of the item currently requested from the virtual data source.

Comments

The Item property returns the SftTreeItem object of the item currently requested from the virtual data source.

Examples

VB.NET

        AxSftTree1.RowColumnHeader.Image.NETImageObject = imageListWorld.Images(m_PicCount)
        m_PicCount = m_PicCount + 1
        If m_PicCount >= imageListWorld.Images.Count Then
            m_PicCount = 0
        End If
    End Sub

    Private Sub AxSftTree1_VirtualItem(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_VirtualItemEvent) Handles AxSftTree1.VirtualItem
        e.itemObject.Item.Cell(0).Text = "Item " & e.rowIndex
        e.itemObject.Item.Cell(1).Text = "Cell " & e.rowIndex
        e.itemObject.Item.Cell(2).Text = "A"
        e.itemObject.Item.Cell(3).Text = (e.rowIndex Mod 7)
        e.itemObject.Item.Cell(4).Text = "Last " & e.rowIndex
        e.itemObject.Item.RowHeader.Text = "R" & e.rowIndex
        e.itemObject.Item.Enabled = ((e.rowIndex Mod 2) = 0)

VB6

Private Sub SftTree1_ItemDblClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer)
    If AreaType = constSftTreeColumnRes Then
        SftTree1.Column(ColIndex).MakeOptimal
    End If
End Sub

Private Sub SftTree1_VirtualItem(ByVal RowIndex As Long, ByVal ItemObject As VirtualItem)
    ItemObject.Item.Cell(0).Text = "Item " & RowIndex
    ItemObject.Item.Cell(1).Text = "Cell " & RowIndex
    ItemObject.Item.Cell(2).Text = "A"
    ItemObject.Item.Cell(3).Text = RowIndex Mod 7
    ItemObject.Item.Cell(4).Text = "Last " & RowIndex
    ItemObject.Item.RowHeader.Text = "R" & RowIndex
    ItemObject.Item.Enabled = ((RowIndex Mod 2) = 0)

    If RowIndex Mod 17 = 0 Then

C#

            axSftTree1.RowColumnHeader.Image.NETImageObject = imageListWorld.Images[m_PicCount];
            ++m_PicCount;
            if (m_PicCount >= imageListWorld.Images.Count)
                m_PicCount = 0;
        }

        private void axSftTree1_VirtualItem(object sender, AxSftTreeLib75._DSftTreeEvents_VirtualItemEvent e) {

            e.itemObject.Item.get_Cell(0).Text = "Item " + e.rowIndex;
            e.itemObject.Item.get_Cell(1).Text = "Cell " + e.rowIndex.ToString();
            e.itemObject.Item.get_Cell(2).Text = "A";
            e.itemObject.Item.get_Cell(3).Text = (e.rowIndex % 7).ToString();
            e.itemObject.Item.get_Cell(4).Text = "Last " + e.rowIndex.ToString();
            e.itemObject.Item.RowHeader.Text = "R" + e.rowIndex.ToString();
            e.itemObject.Item.Enabled = ((e.rowIndex % 2) == 0);

C++

        m_vTree->Column[ColIndex]->MakeOptimal();
}

void CVirtualDlg::OnVirtualItemSftTree1(long RowIndex, LPDISPATCH ItemObject)
{
    IVirtualItemPtr pItemObj = ItemObject;
    CString str;
    str.Format(_T("Item %ld"), RowIndex);
    pItemObj->Item->Cell[0]->Text = (LPCTSTR) str;

    str.Format(_T("Cell %ld"), RowIndex);
    pItemObj->Item->Cell[1]->Text = (LPCTSTR) str;

    pItemObj->Item->Cell[2]->Text = _T("A");

    str.Format(_T("%ld"), RowIndex % 7);

See Also VirtualItem Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.