GridEditingSettingsBuilder
Methods
Readonly(System.Boolean)
Places the component in a Readonly or Editable mode.
Parameters
value - System.Boolean
The boolean value for placing the component in a Readonly or Editable mode.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(settings => settings.Readonly(true))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Enabled(System.Boolean)
Enables or disables grid editing.
Parameters
value - System.Boolean
The boolean value for enabling or disabling the grid editing.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(settings => settings.Enabled(true))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Mode(Kendo.Mvc.UI.GridEditMode)
Sets the Edit Mode for a Grid.
Parameters
mode - GridEditMode
The grid edit Mode.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(e => e.Mode(GridEditMode.InCell))
.DataSource(dataSource => dataSource
.Ajax()
.Model(m => m.Id(o => o.OrderID))
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
.Update(u => u.Action("Update", "Grid"))
)
)
Window(System.Action)
Parameters
configurator - System.Action<WindowBuilder>
TemplateName(System.String)
Specify an editor template to be used in PopUp edit mode.
Parameters
templateName - System.String
The name of the editor template.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(e => e.Mode(GridEditMode.PopUp).TemplateName("EditorTemplateName"))
.DataSource(dataSource => dataSource
.Ajax()
.Model(m => m.Id(o => o.OrderID))
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
.Update(u => u.Action("Update", "Grid"))
)
)
TemplateComponentName(System.String)
Parameters
templateName - System.String
AdditionalViewData(System.Object)
Provides additional view data in the editor template.
Parameters
additionalViewData - System.Object
An anonymous object which contains the additional data
Example
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(editing => editing.AdditionalViewData(new { customers = Model.Customers }))
)
DisplayDeleteConfirmation(System.Boolean)
Enables or disables delete confirmation.
Parameters
value - System.Boolean
The boolean value for displaying a delete confirmation message.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(settings => settings.DisplayDeleteConfirmation(true))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
DisplayDeleteConfirmation(System.String)
Displays a message in the delete confirmation dialog.
Parameters
message - System.String
The message
Example
@(Html.Kendo().Grid<Order>()
.Name("Orders")
.Editable(settings => settings.DisplayDeleteConfirmation("Delete record"))
)
DisplayDeleteConfirmation(System.Func)
Displays a message in the delete confirmation dialog.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag (Razor syntax)
Example
@(Html.Kendo().Grid<Order>()
.Name("Orders")
.Editable(settings => settings.DisplayDeleteConfirmation(
@<text>
function(e) {
//handling code
}
</text>
))
)
ConfirmDelete(System.String)
Change default text for confirm delete button. Note: Available only on mobile devices.
Parameters
text - System.String
The text for the ConfirmDelete action.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(settings => settings.ConfirmDelete("Yes"))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
CancelDelete(System.String)
Change default text for cancel delete button. Note: Available only on mobile devices.
Parameters
text - System.String
The text for the CancelDelete action.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(settings => settings.CancelDelete("No"))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
CreateAt(Kendo.Mvc.UI.GridInsertRowPosition)
Sets insert row position.
Parameters
position - GridInsertRowPosition
The position of the row inserted.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable()
.Editable(settings => settings.CreateAt(GridInsertRowPosition.Bottom))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)