@(Html.Kendo().Grid(Model.row)
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(l => l.LRId).Hidden();
columns.Bound(l => l.StartDate).Format(
"{0:d}"
);
columns.Bound(l => l.Amount);
columns.Command(command => command.Custom(
"logicalDelete"
));
//.Click("udmAltDelete"));
})
.ToolBar(toolbar => toolbar.Create())
.Editable(ed => ed.Mode(GridEditMode.InCell))
.DataSource(ds => ds
.Ajax()
.Batch(
true
)
.ServerOperation(
false
)
.Model(model =>
{
model.Id(l => l.LRId);
})
)
)
Hi,
I am trying to retain the edit mode of the cell in the Gantt Chart when the modelState has errors.
<script>
function error(e) {
var grid = $("#gantt").data("kendoGantt");
grid.one("dataBinding", function(args) {
e.preventDefault();
});
if (e.errors) {
var msg = "";
$.each(e.errors, function(key, value) {
if (value.hasOwnProperty("errors")) {
$.each(value.errors, function() {
msg += this + "<br />";
});
}
});
alert(msg);
}
}
</script>
@(Html.Kendo().Gantt<TaskGantt, TaskGanttDependency>()
.Name("gantt")
.DataSource(ds => ds
.Read(read => read
.Action("Tasks", "Home")
)
.Update(update => update
.Action("Update", "Home")
)
.Events(events => events
.Error("error")
)
.Model(m =>
{
m.Id(f => f.Id);
m.ParentId(f => f.ParentId);
m.OrderId(f => f.OrderId);
m.Field(f => f.Expanded).DefaultValue(true);
})
)
.DependenciesDataSource(ds => ds
.Read(read => read
.Action("Dependencies", "Home")
)
.Model(m =>
{
m.Id(f => f.DependencyId);
m.PredecessorId(f => f.PredecessorId);
m.SuccessorId(f => f.SuccessorId);
m.Type(f => f.Type);
})
)
.Columns(columns =>
{
columns.Bound("title").Editable(true).Sortable(true);
columns.Bound("end").Title("End Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(true).Sortable(true);
})
.Views(views =>
{
views.WeekView(weekView => weekView.Selected(true));
views.MonthView();
})
.Events(events=> events
.DataBound("onDataBound")
)
.Height(500)
.ShowWorkHours(false)
.ShowWorkDays(false)
.Snap(false)
.Resizable(true)
)
I have used the above code, but i am not able to retain the edit mode for a single cell when the ModelState has errors.I have attached the image of how the gantt chart should look after update is called and ModelState returns error.
Can i get to know if I have missed any thing or any other approach is there to carry on with the requirement.
Thanks
Hi,
I want to ask if there is a way to set up kendo work offline mode with foreign key dropdown in asp.net mvc?
I checked the demo for kendo work offline, but that demo is so simple with data structure, I wonder if someone can provide a work offline example that works with one or two foreign key dropdown column.
Thanks,
Ricky
I have a grid where I'm dynamically setting the columns at run time. However, I've come into a problem as the grid fails to show any data when the record set is quite large, in this case, 49K rows.
Has anyone else tried a similar approach with success?
Using the most recent version of the trial for MVC UI and I'm unable to get some important features working, for example the gird filter ROW option and the Excel file export.
Please advise should I have all features enabled in the trial and if not, how can I evaluate properly?
For example for both of these I get errors (Excel shown). When I take out the offending line it's all good.
.Excel(excel => excel
.FileName("Customer List.xlsx")
)
Compilation ErrorDescription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'Kendo.Mvc.UI.Fluent.GridBuilder<KendoUI.Sasco.Dashboard.Models.CustomerViewModel>' does not contain a definition for 'Excel' and no extension method 'Excel' accepting a first argument of type 'Kendo.Mvc.UI.Fluent.GridBuilder<KendoUI.Sasco.Dashboard.Models.CustomerViewModel>' could be found (are you missing a using directive or an assembly reference?)
If I refer to the kendo.mvc.dll in the distribution folder I get a license error - the reference that exists is to the example/sample folder that I downloaded.
Using Grid with MVC works fine, but unless I missed it, there does not seem to be many choices for formatting such as bold text, resizing/larger text; And When using MVC to make a simple table, I had used the html action link so that clicking on an item takes the browser to a specific page. Is this not supported in Grid?
for example, using this kind of html: <td style="font-size: larger; font-weight: 700;">@Html.ActionLink("Click here to go to the page", "index", "/home/index")</td>
If not, is there another kind of Grid item available that does?
Thanks
Hi,
Was wondering if there is a Loader like the combobox, that could be displayed over the spinner part, while an Ajax call is made to fill in this field.
I thought that the following would work
kendo.ui.progress($("#txtNumericValueField"), true);
Hi,
I have the following code in my controller and in the mapping of my entity I navigate a foreign key. (Plate = anomalie.voiture.plaque)
That gives me the following exception:
An exception of type 'System.Data.Entity.Core.EntityCommandExecutionException' occurred in EntityFramework.dll but was not handled in user code
There is already an open DataReader associated with this Connection which must be closed first.
I tried to add an include() but doesn't solve the problem. Any ideas ?
public
ActionResult Read([DataSourceRequest]DataSourceRequest request)
{
using
(var context =
new
carpackEntities())
{
IQueryable<anomalie> damages = context.anomalie;
damages.Include(d => d.voiture);
var result = Json(damages.ToDataSourceResult(request, damage =>
new
DamageViewModel()
{
Date = damage.dtajout,
Description = damage.avarie,
Driver = damage.chauffeur,
Plate = damage.voiture.plaque,
Service = damage.service,
State = damage.etat.ToString()
}));
return
result;
}
}