I am using Telerik's UI for ASP.NET
widgets. Most of these widgets have multiple configuration options. In .cshtml
file i configure these widgets on multiple lines for readability.
For example below is the configuration for Grid widget.
<div class="row">
<div class="col-md-12">
@(Html.Kendo().Grid<ResultModel>()
.Name("SearchGrid")
.Columns(col =>
{
col.Bound(p => p.DocumentID);
col.Bound(p => p.UploadDate);
col.Bound(p => p.DocumentType);
col.Bound(p => p.ProcessStatus);
col.Bound(p => p.StateProvince);
col.Bound(p => p.Error);
col.Bound(p => p.Notes);
})
.AutoBind(false)
.Pageable()
.Sortable()
.Resizable(resize => resize.Columns(true))
.Scrollable()
.Sortable(sortable => sortable
.AllowUnsort(true)
.SortMode(GridSortMode.MultipleColumn))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(50)
.ServerOperation(true)
.Read(read => read.Action("Search", "Search"))
).Deferred())
</div>
</div>
After editing cshtml file i press Control + K + D
to auto format. Visual studio properly formats the html and anything configured in one line. But any widget that is configured on multiple lines gets indented by one tab. So in above case everything from .Name("SearchGrid")
to ).Deferred()))
gets indented by one tab.
The problem is every time i edit cshtml i press Control + K + D
to format edited cshtml, but that causes all other widgets to indent by one tab. and eventual all these widgets move to extreme right of the page