or
@( Html.Kendo().Grid<
Location
>()
.Name("selectedLocations")
.BindTo((IEnumerable<
Location
>)ViewBag.Route.SelectedLocations)
.Columns(columns =>
{
columns.Bound(p => p.Id).Title("ID");
columns.Bound(p => p.StopLocation).Title("Stop Location");
})
.Selectable(s => s.Mode(GridSelectionMode.Single))
.DataSource(dataSource => dataSource.Server().Model(model => model.Id(p => p.Id)))
)
$(
"#addStopBtn"
).click(
function
() {
var
sourceGrid = $(
'#availableLocations'
).data(
'kendoGrid'
);
var
destinationGrid = $(
'#selectedLocations'
).data(
'kendoGrid'
);
sourceGrid.select().each(
function
(e) {
var
dataItem = sourceGrid.dataItem($(
this
));
destinationGrid.dataSource.add(dataItem);
sourceGrid.dataSource.remove(dataItem);
});
sourceGrid.refresh();
destinationGrid.refresh();
});
Requirements |
|
Kendo UI Suite and Version |
|
jQuery Version |
|
Supported Browsers and Platforms |
|
Components/Widgets used |
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> <add name="Northwind" connectionString="metadata=res://*/App_Code.Northwind.csdl|res://*/App_Code.Northwind.ssdl|res://*/App_Code.Northwind.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Northwind.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient"/>