Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

HyperlinkCollection Class

A collection of the Hyperlink objects.

#Declaration

TypeScript
export class HyperlinkCollection extends Collection<Hyperlink>

#Inherited Members

#Inheritance

Collection<T>
HyperlinkCollection

#Methods

#create(position, hyperlinkInfo) Method

Creates a new Hyperlink object with the specified settings and adds it to the collection.

#Declaration

TypeScript
create(
    position: number | IInterval,
    hyperlinkInfo: HyperlinkInfo
): Hyperlink

#Parameters

Name Type Description
position number | IInterval

The hyperlink position or interval.

hyperlinkInfo HyperlinkInfo

An object that contains hyperlink settings.

#Returns

Type Description
Hyperlink

The newly created hyperlink.

#Remarks

var text = "Visit our site";
var url = "https://www.devexpress.com/";
var tooltip = "DevExpress site";

richEdit.beginUpdate();
richEdit.history.beginTransaction();
var subDocument = richEdit.selection.activeSubDocument;

var position = richEdit.selection.active;
position = subDocument.insertParagraph(position).interval.end;
position = subDocument.hyperlinks.create(position, new DevExpress.RichEdit.HyperlinkInfo(text, url, "", tooltip)).interval.end;
subDocument.insertParagraph(position);

richEdit.endUpdate();
richEdit.history.endTransaction();

#find(position) Method

Returns a list of hyperlinks that traverse the specified position or interval.

#Declaration

TypeScript
find(
    position: number | IInterval
): Hyperlink[]

#Parameters

Name Type Description
position number | IInterval

A document position or interval.

#Returns

Type Description
Hyperlink[]

A list of hyperlinks.