Skip to main content
A newer version of this page is available. .

LayoutViewInfoCustomizingEventArgs.ShouldRecalculateLayout Property

Forces layout recalculation after applying changes specified in the event handler.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v18.2.dll

Declaration

public bool ShouldRecalculateLayout { get; set; }

Property Value

Type Description
Boolean

True, to recalculate the layout to properly display modified visual elements; otherwise, false.

Remarks

Set the ShouldRecalculateLayout option to true to force layout recalculation, so that changes applied to the header in the SchedulerControl.LayoutViewInfoCustomizing event handler display correctly.

This setting is useful when certain changes, such as larger font or longer text, results in a header content that does not fit its previously calculated bounds.

Note

This setting affects only date and resource headers. Other visual elements layouts are not recalculated.

Example

This example handles the SchedulerControl.LayoutViewInfoCustomizing event to change resource header captions.

Longer text or a new line in the caption require that the header increases its height to fit the content. The ShouldRecalculateLayout option set to true forces layout recalculation so that changes applied to the header display correctly.

    scheduler.GroupType = SchedulerGroupType.Resource;
    scheduler.ActiveViewType = SchedulerViewType.Timeline;
    scheduler.LayoutViewInfoCustomizing += scheduler_LayoutViewInfoCustomizingResourceHeaders; ;
    scheduler.ActiveView.LayoutChanged();
public static void scheduler_LayoutViewInfoCustomizingResourceHeaders(object sender, LayoutViewInfoCustomizingEventArgs e) {
    if (e.Kind == LayoutElementKind.ResourceHeader) {
        ResourceHeader header = e.ViewInfo as ResourceHeader;
        header.Caption = header.Resource.Caption + "\r\nNew long text line";
        e.ShouldRecalculateLayout = true;
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShouldRecalculateLayout property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also