Back to Devexpress

ResizableBuilder.KeepAspectRatio(JS) Method

aspnetcore-devextreme-dot-aspnet-dot-mvc-dot-builders-dot-resizablebuilder-dot-keepaspectratio-x28-devextreme-dot-aspnet-dot-mvc-dot-js-x29.md

latest1.5 KB
Original Source

ResizableBuilder.KeepAspectRatio(JS) Method

Specifies whether to resize the UI component's content proportionally when you use corner handles. Mirrors the client-side keepAspectRatio option.

Namespace : DevExtreme.AspNet.Mvc.Builders

Assembly : DevExtreme.AspNet.Core.dll

Declaration

csharp
public ResizableBuilder KeepAspectRatio(
    JS value
)

Parameters

NameTypeDescription
valueJS

A JavaScript expression that specifies the option value.

|

Returns

TypeDescription
ResizableBuilder

A reference to this instance after the method is called.

|

Remarks

Use the new JS() expression to set the option’s value.

cshtml
<script>
    var myValue = ...;
</script>

@(Html.DevExtreme().Resizable()
    .KeepAspectRatio(new JS("myValue"))
)

See Also

ResizableBuilder Class

ResizableBuilder Members

DevExtreme.AspNet.Mvc.Builders Namespace