ObjectFormatter.CustomFormatObject Event

Occurs when the ObjectFormatter.Format method is called. Allows you to perform the custom processing of the string passed to the Format method.

Namespace: DevExpress.Persistent.Base

Assembly: DevExpress.ExpressApp.v18.1.dll


public static event EventHandler<CustomFormatObjectEventArgs> CustomFormatObject
Public Shared Event CustomFormatObject As EventHandler(Of CustomFormatObjectEventArgs)

The event handler receives an argument of the CustomFormatObjectEventArgs type. The CustomFormatObjectEventArgs properties provide information specific to this event.

The Format method replaces format items in a string with the property values of an object. If its formatting behavior does not suit you, handle this event. The string to be formatted is passed as the event handler's CustomFormatObjectEventArgs.FormatString parameter. The object to be used to replace format items is passed as the event handler's CustomFormatObjectEventArgs.Object parameter. After you have processed the string, pass the result to the handler's CustomFormatObjectEventArgs.Result parameter. Set the handler's CustomFormatObjectEventArgs.Handled parameter to true, to indicate that you have completely processed the passed string. Otherwise, the changes you have made will be discarded and the Format method will perform the default processing of the string.

See Also