Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Data Property, SftTreeCell Object

Defines the cell's application specific numeric value.

Syntax

Get

VB.NETNumber = object.Data As Integer
VBNumber = object.Data As Long
C#.NETint Number = object.Data;
VC++long Number = object->Data;
long Number = object->GetData();
CHRESULT object->get_Data(long* Number);

Put

VB.NETobject.Data = Number As Integer
VBobject.Data = Number As Long
C#.NETint object.Data = Number;
VC++long object->Data = Number;
void object->PutData(long Number);
CHRESULT object->put_Data(long Number);

object

A SftTreeCell object.

Number

Defines the cell's application specific numeric value.

Comments

The Data property defines the cell's application specific numeric value.

The Data property can be used to store application specific data with a cell. Possible uses include storing pointers to data structures or values used for sorting purposes (see Items.SortDependents method).

The Cell.DataString, Cell.DataObject, Cell.DataTag properties can be used to store additional application specific data, using other data types (strings, objects, variants).

Additional properties used to associate an application defined value with an item are Item.Data, Item.DataTag, Item.DataObject, Item.DataFloat and Item.DataString. These are distinct properties and can be used at the same time.

Examples

VB.NET

    End Sub

    Private Function AddFolder(ByVal Folder As String, ByVal Desc As String, ByVal Count As Integer) As Integer

        Dim ItemIndex As Integer
        ItemIndex = AxSftTree1.Items.Add(Folder) ' add folder
        AxSftTree1.get_Cell(ItemIndex, 1).Text = Desc ' add description
        AxSftTree1.get_Cell(ItemIndex, 3).Text = Count.ToString() ' add number of messages
        AxSftTree1.get_Cell(ItemIndex, 3).Data = Count ' also save number of messages for sorting

        ' make the folder name bold
        If m_BoldFont Is Nothing Then
            m_BoldFont = AxSftTree1.get_Cell(ItemIndex, 0).Font
            m_BoldFont.Bold = True
        End If
        AxSftTree1.get_Cell(ItemIndex, 0).Font = m_BoldFont

VB6

Dim DeletedFolder As Long

Private Function AddFolder(ByVal Folder As String, ByVal Desc As String, ByVal Count As Integer)
    Dim ItemIndex As Long
    With SftTree1
        ItemIndex = .Items.Add(Folder)    ' add folder
        .Cell(ItemIndex, 1).Text = Desc   ' add description
        .Cell(ItemIndex, 3).Text = Count  ' add number of messages
        .Cell(ItemIndex, 3).Data = Count  ' also save number of messages for sorting

        ' make the folder name bold
        .Cell(ItemIndex, 0).Font.Bold = True

        ' if this folder has no messages (ie. dependents), we still want the
        ' folder graphic, not the email (leaf) graphic
        If Count = 0 Then

C#

            axSftTree1_CaretChange(this, new _DSftTreeEvents_CaretChangeEvent(0));
        }

        private int AddFolder(string Folder, string Desc, int Count)
        {
            int ItemIndex = axSftTree1.Items.Add(Folder); // add folder
            axSftTree1.get_Cell(ItemIndex, 1).Text = Desc; // add description
            axSftTree1.get_Cell(ItemIndex, 3).Text = Count.ToString(); // add number of messages
            axSftTree1.get_Cell(ItemIndex, 3).Data = Count; // also save number of messages for sorting

            // make the folder name bold
            if (m_BoldFont == null) {
                m_BoldFont = axSftTree1.get_Cell(ItemIndex, 0).Font;
                m_BoldFont.Bold = true;
            }
            axSftTree1.get_Cell(ItemIndex, 0).Font = m_BoldFont;

C++

long CEmailDlg::AddFolder(LPCTSTR lpszFolder, LPCTSTR lpszDescription, int Count)
{
    long ItemIndex;
    ItemIndex = m_vTree->Items->Add(lpszFolder);
    m_vTree->Cell[ItemIndex][1]->Text = lpszDescription;// add description
    CString str;
    str.Format(_T("%d"), Count);
    m_vTree->Cell[ItemIndex][3]->Text = (LPCTSTR) str; // add number of messages
    m_vTree->Cell[ItemIndex][3]->Data = Count;    // also save number of messages for sorting

    // make the folder name bold
    IFontDispPtr pFont = m_pBoldCellFont;
    m_vTree->Cell[ItemIndex][0]->PutRefFont(pFont);

    // if this folder has no messages (ie. dependents), we still want the
    // folder graphic, not the email (leaf) graphic

See Also SftTreeCell Object | Object Hierarchy


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