Back to Devexpress

DiagramBuilder.SnapToGrid(JS) Method

aspnetcore-devextreme-dot-aspnet-dot-mvc-dot-builders-dot-diagrambuilder-dot-snaptogrid-x28-devextreme-dot-aspnet-dot-mvc-dot-js-x29.md

latest1.4 KB
Original Source

DiagramBuilder.SnapToGrid(JS) Method

Specifies whether diagram elements should snap to grid lines. Mirrors the client-side snapToGrid option.

Namespace : DevExtreme.AspNet.Mvc.Builders

Assembly : DevExtreme.AspNet.Core.dll

Declaration

csharp
public DiagramBuilder SnapToGrid(
    JS value
)

Parameters

NameTypeDescription
valueJS

A JavaScript expression that specifies the option value.

|

Returns

TypeDescription
DiagramBuilder

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().Diagram()
    .SnapToGrid(new JS("myValue"))
)

See Also

DiagramBuilder Class

DiagramBuilder Members

DevExtreme.AspNet.Mvc.Builders Namespace