TX Text Control .NET Server

GetItem Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Gets a particular document link from the collection.

Syntax

GetItem()

Gets the document link at the current input position or null if there is no document link at the current input position.

public DocumentLink GetItem();

GetItem(int)

Gets the document link with the specified id, previously set with the DocumentLink.ID property.

public DocumentLink GetItem(int id);
ParameterDescription
id

Specifies the document link's identifier. The method returns null if a document link with the specified identifier does not exist.

Examples

The following example works with document links in the current document by using DocumentLinkCollection.get_Item.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentLinkCollection documentLinkCollection = textControl.DocumentLinks;
DocumentTarget target = new("CustomerDetails");
textControl.DocumentTargets.Add(target);
documentLinkCollection.Add(new DocumentLink("View customer details", target) { ID = 100 });

DocumentLink result = documentLinkCollection.GetItem(100);
result?.ScrollTo();