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

Event<TSource, TEventArgs> Class

The event object used for client-side events.

#Declaration

TypeScript
export class Event<TSource, TEventArgs extends EventArgs>

#Type Parameters

Name Description
TSource

The type of an event source.

TEventArgs EventArgs

The type of an event argument.

#Inheritance

Event<TSource, TEventArgs>

#Methods

#addHandler(handler) Method

Dynamically connects the event with an appropriate event handler function.

#Declaration

TypeScript
addHandler(
    handler: (s?: TSource,
    e?: TEventArgs) => void,
    executionContext?: TSource
): void

#Parameters

Name Type Description
handler (s?: TSource, e?: TEventArgs) => void

The event handler function’s content.

executionContext TSource

The source.

#clearHandlers Method

Dynamically disconnects the event from all the associated event handler functions.

#Declaration

TypeScript
clearHandlers(): void

#isEmpty Method

Gets whether the event handler is empty.

#Declaration

TypeScript
isEmpty(): boolean

#Returns

Type Description
boolean

true, if the event handler content is empty; otherwise, false

#removeHandler(handler) Method

Dynamically disconnects the event from the associated event handler function.

#Declaration

TypeScript
removeHandler(
    handler: (s?: TSource,
    e?: TEventArgs) => void,
    executionContext?: TSource
): void

#Parameters

Name Type Description
handler (s?: TSource, e?: TEventArgs) => void

The event handler function’s content.

executionContext TSource

The source.