Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

DataTag Property, SftTreeCell Object

Defines the cell's application specific variant value.

Syntax

Get

VB.NETV = object.DataTag As Object
VBV = object.DataTag As Variant
C#.NETobject V = object.DataTag;
VC++_variant_t V = object->DataTag;
_variant_t V = object->GetDataTag();
CHRESULT object->get_DataTag(VARIANT* V);

Put

VB.NETobject.DataTag = V As Object
VBobject.DataTag = V As Variant
C#.NETobject object.DataTag = V;
VC++_variant_t object->DataTag = V;
void object->PutDataTag(const _variant_t& V);
CHRESULT object->put_DataTag(VARIANT V);

object

A SftTreeCell object.

V

Defines the cell's application specific variant value.

Comments

The DataTag property defines the cell's application specific variant value.

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

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

        Dim Dt As DateTime
        ItemIndex = AxSftTree1.Items.Add("5.33")
        AxSftTree1.get_Cell(ItemIndex, 0).TextHAlign = SftTreeHAlignDefaultConstants.halignSftTreeDefaultRight
        AxSftTree1.get_Cell(ItemIndex, 1).Text = "Option 1"
        Dt = DateTime.Today.AddDays(-1)
        s = "short"
        SftMaskDateTime.Calendar.FormatDate(Dt, s)
        AxSftTree1.get_Cell(ItemIndex, 2).Text = s
        AxSftTree1.get_Cell(ItemIndex, 2).DataTag = Dt

        ItemIndex = AxSftTree1.Items.Add("122.33")
        AxSftTree1.get_Cell(ItemIndex, 0).TextHAlign = SftTreeHAlignDefaultConstants.halignSftTreeDefaultRight
        AxSftTree1.get_Cell(ItemIndex, 1).Text = "Option 3"
        Dt = DateTime.Today
        s = "short"
        SftMaskDateTime.Calendar.FormatDate(Dt, s)

VB6

    ItemIndex = SftTree1.Items.Add("5.33")
    SftTree1.Cell(ItemIndex, 0).TextHAlign = halignSftTreeDefaultRight
    SftTree1.Cell(ItemIndex, 1).Text = "Option 1"
    Dt = Date - 1
    S = "short"
    SftMaskDateTime.Calendar.FormatDate Dt, S
    SftTree1.Cell(ItemIndex, 2).Text = S
    SftTree1.Cell(ItemIndex, 2).DataTag = Dt

    ItemIndex = SftTree1.Items.Add("122.33")
    SftTree1.Cell(ItemIndex, 0).TextHAlign = halignSftTreeDefaultRight
    SftTree1.Cell(ItemIndex, 1).Text = "Option 3"
    Dt = Date
    S = "short"
    SftMaskDateTime.Calendar.FormatDate Dt, S
    SftTree1.Cell(ItemIndex, 2).Text = S

C#

            ItemIndex = axSftTree1.Items.Add("5.33");
            axSftTree1.get_Cell(ItemIndex, 0).TextHAlign = SftTreeHAlignDefaultConstants.halignSftTreeDefaultRight;
            axSftTree1.get_Cell(ItemIndex, 1).Text = "Option 1";
            Dt = DateTime.Today.AddDays(-1);
            string s;
            s = "short";
            SftMaskDateTime.Calendar.FormatDate(Dt, ref  s);
            axSftTree1.get_Cell(ItemIndex, 2).Text = s;
            axSftTree1.get_Cell(ItemIndex, 2).DataTag = Dt;

            ItemIndex = axSftTree1.Items.Add("122.33");
            axSftTree1.get_Cell(ItemIndex, 0).TextHAlign = SftTreeHAlignDefaultConstants.halignSftTreeDefaultRight;
            axSftTree1.get_Cell(ItemIndex, 1).Text = "Option 3";
            Dt = DateTime.Today;
            s = "short";
            SftMaskDateTime.Calendar.FormatDate(Dt, ref  s);

C++

    ItemIndex = m_vTree->Items->Add(_T("5.33"));
    m_vTree->Cell[ItemIndex][0]->TextHAlign = halignSftTreeDefaultRight;
    m_vTree->Cell[ItemIndex][1]->Text = _T("Option 1");
    BSTR str;
    str = SysAllocString(L"short");
    m_vDate->Calendar->FormatDate(Dt-1, &str);
    m_vTree->Cell[ItemIndex][2]->Text = str;
    SysFreeString(str);
    m_vTree->Cell[ItemIndex][2]->DataTag = Dt - 1;

    ItemIndex = m_vTree->Items->Add(_T("122.33"));
    m_vTree->Cell[ItemIndex][0]->TextHAlign = halignSftTreeDefaultRight;
    m_vTree->Cell[ItemIndex][1]->Text = _T("Option 2");
    str = SysAllocString(L"short");
    m_vDate->Calendar->FormatDate(Dt, &str);
    m_vTree->Cell[ItemIndex][2]->Text = str;

See Also SftTreeCell Object | Object Hierarchy


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