HeaderPane
Main
Hide
Share Link
Print

Add Method, PartsCollectionClass Class

Adds the specified part to the parts collection.

Class: PartsCollectionClass
Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Syntax

public int Add( GenericPartClass Part );
Public Function Add( ByVal Part As GenericPartClass ) As Integer

Parameters

Part

Defines the new part to append to the parts collection.

Return Value

The zero-based index of the newly added part.

Comments

Adds the specified part to the parts collection.

Examples

C# View entire sample code

                string strcheck = "";
                try {
                    strcheck = elem.Attributes["Status"].Value;
                } catch {
                    strcheck = "";
                }
                if (strcheck != "")
                    check = (strcheck != "0") ? CheckBoxStateEnum.Checked : CheckBoxStateEnum.Unchecked;
                newItem.Cells[0].Parts.Add(new CheckBoxPartClass(check));
            } else if (elem.Name == "Radiobutton") {
                RadioButtonStateEnum check = RadioButtonStateEnum.Unchecked;
                string strcheck = "";
                try {
                    strcheck = elem.Attributes["Status"].Value;
                } catch {
                    strcheck = "";

VB.NET View entire sample code

        End Try
        If (strcheck <> "") Then
            If strcheck <> "0" Then
                check = CheckBoxStateEnum.Checked
            Else
                check = CheckBoxStateEnum.Unchecked
            End If
        End If
        newItem.Cells(0).Parts.Add(New CheckBoxPartClass(check))
    ElseIf elem.Name = "Radiobutton" Then
        Dim check As RadioButtonStateEnum = RadioButtonStateEnum.Unchecked
        Dim strcheck As String = ""
        Try
            strcheck = elem.Attributes("Status").Value
        Catch
            strcheck = ""

See Also PartsCollectionClass Class | Classes | SftTree/NET 3.0