Skip to main content

GanttLocalizer.GetString(GanttStringId) Method

Returns a caption or a date-time format for the specified visual element.

Namespace: DevExpress.XtraGantt.Localization

Assembly: DevExpress.XtraGantt.v24.1.dll

NuGet Package: DevExpress.Win.Gantt

Declaration

public static string GetString(
    GanttStringId id
)

Parameters

Name Type Description
id GanttStringId

A value that specifies a visual element for which to return a caption or date-time format.

Returns

Type Description
String

A String value that specifies a caption or date-time format.

Example

The code below shows how to localize the date-time format for days in the timescale ruler and captions for commands in a Ribbon control.

using DevExpress.XtraGantt.Localization;

GanttLocalizer.Active = new MyGanttLocalizer();

public class MyGanttLocalizer : GanttLocalizer {
    public override string GetLocalizedString(GanttStringId id) {
        switch (id) {
            case GanttStringId.BothPanelsVisibilityCaption: return "Task List and Chart"; break;
            case GanttStringId.DayFormat: return "dddd, d"; break;
            default: return base.GetLocalizedString(id);
        }
    }
}
See Also