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

SpinEditProperties.MaxValue Property

Gets or sets the maximum value of the editor.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

[DefaultValue(typeof(decimal), "0")]
public decimal MaxValue { get; set; }

Property Value

Type Default Description
Decimal "0"

A Decimal value representing the maximum value of the editor.

Remarks

Use the MaxValue property to specify the maximum value of the spin editor. Note, that this value applies only to the ASPxSpinEdit.Number property and not to the ASPxSpinEdit.Value property. The ASPxSpinEdit.Value property of a spin editor can be set to a value greater than the MaxValue property value. But, editing the editor’s value can only be performed within the ASPxSpinEdit.MinValue-MaxValue range. If both these properties have values of 0, then the editor’s value is not limited.

The low limit of the ASPxSpinEdit.Number property is specified via the ASPxSpinEdit.MinValue property.

Note

The MaxValue property synchronizes its value with the editor’s ASPxSpinEdit.MaxValue property.

Example

WebForms approach:

Note

For a full example, see the ASPxGridView - Customization Dialog demo.

<dx:ASPxGridView ID="Grid" runat="server" DataSourceID="ProductsDataSource" 
    EnableRowsCache="false" Width="100%">
    <Columns>
        <dx:GridViewDataSpinEditColumn FieldName="UnitPrice" SortIndex="1" SortOrder="Ascending" Width="150">
            <PropertiesSpinEdit DisplayFormatString="c" MinValue="0" MaxValue="60000" />
        </dx:GridViewDataSpinEditColumn>
        <dx:GridViewDataSpinEditColumn FieldName="UnitsInStock" Width="150">
            <PropertiesSpinEdit MinValue="0" MaxValue="10000" />
        </dx:GridViewDataSpinEditColumn>
        ...
    </Columns>
</dx:ASPxGridView>

MVC approach:

Note

For a full example, see the GridView - Customization Dialog demo.

@Html.DevExpress().GridView(settings => {
    settings.Name = "GridView";
    settings.SettingsCustomizationDialog.Enabled = true;
    ...
    settings.Columns.Add(c => {
        c.FieldName = "UnitPrice";
        c.SortIndex = 0;
        c.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
        c.Width = 120;
        c.EditorProperties().SpinEdit(sp => {
            sp.DisplayFormatString = "c";
            sp.MinValue = 0;
            sp.MaxValue = 60000;
        });
    });
    settings.Columns.Add(c => {
        c.FieldName = "UnitsInStock";
        c.Width = 140;
        c.EditorProperties().SpinEdit(sp => {
            sp.NumberType = SpinEditNumberType.Integer;
            sp.MinValue = 0;
            sp.MaxValue = 10000;
        });
    });

}).Bind(Model).GetHtml()

GridViewDataSpinEditColumn

See Also