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

LayoutViewInfoCustomizingEventArgs.ShouldRecalculateLayout Property

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

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

NuGet Package: DevExpress.Win.Scheduler

#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; ;

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;
    }
}
See Also