or
<%: Html.Kendo().Chart<Data.DonneeChart>()
.Name(
"chart"
)
.Title(
"Multiple Series Chart"
)
.DataSource(dataSource => dataSource
.Read(read => read.Action(
"Charts_Data"
,
"Home"
)).ServerOperation(
false
)
)
.Series(series => {
series.Line(model => model.Weight1)
.Color(
"#ff1a1c"
)
.Name(
"Weight1"
)
.Axis(
"weight"
);
series.Line(model => model.Time1)
.Color(
"#ff0e00"
)
.Name(
"Time1"
)
.Axis(
"time"
);
series.Line(model => model.Weight2)
.Color(
"#73e100"
)
.Name(
"Weight2"
)
.Axis(
"weight"
);
series.Bar(model => model.Time2)
.Color(
"#007aff"
)
.Name(
"Time2"
)
.Axis(
"time"
);
})
.CategoryAxis(axis => axis
.Categories(model => model.Period)
.AxisCrossingValue(0,9999,9999)
.Justify(
true
)
.Crosshair(crosshair => crosshair
.Visible(
true
)
.Tooltip(tooltip => tooltip
.Visible(
true
)
.Template(
"Category : #= value #"
)
// Here i would like to show the value of Weight1,Time1,Weight2,Time2 instead of Period value !!!
.Format(
"{0:n1}"
)
))
)
.ValueAxis(axis => axis
.Numeric(
"weight"
)
.Min(0)
.Title(
"(Kg)"
)
.Max(8000)
)
.ValueAxis(axis => axis
.Numeric(
"weight"
)
.Color(
"#ffae00"
)
.Min(0)
.Max(35)
)
.ValueAxis(axis => axis
.Numeric(
"weight"
)
.Color(
"#007eff"
)
.Min(0)
.Max(1.1)
)
.Tooltip(tooltip => tooltip
.Visible(
false
)
)
%>
@(Html.Kendo().Grid<
CDIFFAudit.Models.AntibioticHistory
>()
.Name("ahGrid")
.Events(e=>e.Edit("onEditah"))
.Columns(columns =>
{
columns.Bound(p => p.ID).Title("ID");
columns.Bound(p => p.AntibioticID).Title("ID");
columns.Bound(p => p.StartDate).Title("Start").Format("{0:d}"); ;
columns.Bound(p => p.Appropriate).Title("Appropriate?");
columns.Command(command => { command.Edit(); });
})
.ToolBar(commands=>commands.Create())
.Editable(editable=>editable
.Mode(GridEditMode.PopUp))
.DataSource(datasource => datasource
.Ajax()
.Model(m=>m.Id(p=>p.ID))
.PageSize(10)
.Read(read => read.Action("GetAntibioticHistory", "CDIff", new { CDiffID = Model.ID }))
.Create(create=>create.Action("insertAntibioticHistory","CDIff"))
.Update(update=>update.Action("updateAntibioticHistory","CDiff"))
)
.Pageable()
.Sortable()
.Filterable()
)
The only answer I can fin about this is this post (http://stackoverflow.com/questions/13384901/grid-into-grid-popup-editor-passing-id-parameter-in-sub-grid ) on StackOverflow , which seems like a complete bodge, and one I don't want, as I'll have at least four grids on this edit form (if it can be made to work).
I need to know whether kendo can support a complex editing scenario such as this, otherwise I'll have to take another route to achieve what's needed.
$(document).ready(
function() {
$(
"#grid").kendoGrid({
dataSource: {
type:
"odata",
transport: {
read:
"http://localhost:61766/WebSite1/WcfDataService.svc/Suppliers"
},
schema: {
model: {
fields: {
SupplierID: { type:
"number" },
ContactName: { type:
"string" }
}
}
},
pageSize: 10,
serverPaging:
true,
serverFiltering:
true,
serverSorting:
true
},
height: 250,
filterable:
true,
sortable:
true,
pageable:
true,
columns: [{
field:
"SupplierID",
filterable:
false
},
"ContactName"
]
});
namespace MvcApplication5.Controllers
{
public class ChildModel
{
public int CategoryId { get; set; }
}
public class ParentModel
{
public int CategoryId { get; set; }
public ChildModel Child { get; set; }
public List<
ChildModel
> Children { get; set; }
}
public class HomeController : Controller
{
public ActionResult Index()
{
var model = new ParentModel
{
CategoryId = 2,
Child = new ChildModel { CategoryId = 2},
Children = new List<
ChildModel
>
{
new ChildModel { CategoryId = 2}
}
};
return View(model);
}
}
}
@model MvcApplication5.Controllers.ParentModel
@{
ViewBag.Title = "Index";
var list = new List<
SelectListItem
>()
{
new SelectListItem() { Value = "1", Text = "one" },
new SelectListItem() { Value = "2", Text = "two" },
new SelectListItem() { Value = "3", Text = "three" },
};
}
<
h2
>all actual categoryid must be 2</
h2
>
<
h3
>[OK] Model.CategoryId: @Model.CategoryId</
h3
>
@(Html.Kendo().DropDownListFor(m => m.CategoryId)
.BindTo(list)
)
<
h3
>[OK] Model.CategoryId: @Model.Child.CategoryId</
h3
>
@(Html.Kendo().DropDownListFor(m => m.Child.CategoryId)
.BindTo(list)
)
<
h3
>[NG] Model.Children[0].CategoryId: @Model.Children[0].CategoryId</
h3
>
@(Html.Kendo().DropDownListFor(m => m.Children[0].CategoryId)
.BindTo(list)
)
<
hr
/>
@Html.TextBoxFor(m => m.Children[0].CategoryId)