Skip to main content
.NET 8.0+

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

IModelLayoutItem.MaxSize Property

Specifies the layout item’s maximum size.

Namespace: DevExpress.ExpressApp.Model

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

Size MaxSize { get; set; }

#Property Value

Type Description
Size

A System.Drawing.Size object that specifies the maximum size of the layout item.

#Remarks

This property value is passed to the LayoutControlItem.MaxSize property. If using the MaxSize property produces unexpected effects, use the Control.MaximumSize property as shown below.

using System;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
using System.Windows.Forms;
//...
public class MyController : ViewController <DetailView> {
    //...
    protected override void OnActivated() {
        base.OnActivated();
        ViewItem item = View.FindItem("FullName");
        item.ControlCreated += Item_ControlCreated;
    }
    private void Item_ControlCreated(object sender, EventArgs e) {
        ((ViewItem)sender).ControlCreated -= Item_ControlCreated;
        ((Control)((ViewItem)sender).Control).MaximumSize = new System.Drawing.Size(300, 0);
    }
}
See Also