I want to use the date category axis which should only show years:
@(Html.Kendo().Chart().Name("CompetenceEvolution")
.SeriesDefaults(sd => sd.Line().Style(ChartLineStyle.Smooth))
.Series(series =>
{
foreach (var data in Model.EvolutionChartData)
{
series.Line(data.Items).Field("Score").CategoryField("AssessmentDate").Name(data.Name);
}
})
.CategoryAxis(axis => axis.Date().BaseUnit(ChartAxisBaseUnit.Years))
...
but I would like that for plotting the points the real date is used (now the point is placed above the category label), but is should be placed according to the date. Because now, when having two different items in the same year (with a different date), only one item is getting plotted to the chart.
Ok my requirement is simple and I am just getting lost in the various partial examples and forum posts on how to do this. What is surprising is I would expect this to be so standard there would hundreds of examples out there but I cannot find one.
I have a basic person model with properties to include a birthdate. All of those properties are on a grid in a MVC 5 Razor view. The grid is setup and works fine. What I would like to do is keep the existing filter capability on the birthdate field but add four additional filters that signify age groupings, so one for under 11 years old, one for between 11 and 14, and one for between 14 and 18, and one for over 18.
Then of course since this is not a field in the actual database, I would need to do "custom server binding" as all the partial examples somewhat show. I have played with the datasourcerequest object in the past and I have no need to implement a fill blown custom binding scenario. Is it possible to just intercept these four requests, pull them out of the IFilterDescriptors, apply them manually, and then pass the remaining request object to the ToDataSourceResult method?
If so I have not seen this either. If someone could please guide me to the right area on this I would appreciate it. To sum up:
1. How do you add custom filters to the grid menu on a column but keep the default ones there?
2. Can you intercept these filters and pull them out of the filter descriptor collection?
3. How would you identify these custom filters to pull them out?
I have a kendogrid:
@(Html.Kendo().Grid<OAIWebInterface.Models.Leadership>()
.Name("LeadershipGrid")
.Columns(columns =>
{
columns.Bound(c => c.LeadershipID).Width(150);
columns.Bound(c => c.Organization).Width(150);
columns.Command(command => { command.Edit(); }).Width(95);
})
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("LeadershipEditorTemplate"))
.HtmlAttributes(new { style = "max-height: 350px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.LeadershipID))
.Read(read => read.Action("Leadership_Read", "AnnualSummary", new { ASId = Model.AnnualSummaryID}))
.Update(update => update.Action("LeadershipPopup_Update", "AnnualSummary"))
)
)
I have a Editor Template called "LeadershipEditorTemplate" in which I got the following code:
@Html.RadioButtonFor(x => x.Reimburse, true)Yes
@Html.RadioButtonFor(x => x.Reimburse, false)No
On edit kendo row, one of the radio buttons in the editor template do not get checked. For example, Yes should be checked when the Reimburse value is true/1 and No should be checked when the value is set to false/0.
I verified that Reimbuse has a value when in template, but can't make it work with radio buttons.
I would appreciate any input on this issue.
Thanks.
Hello
I have question how to refresh control after edit?
I tried:
public
JsonResult Update([DataSourceRequest] DataSourceRequest request, ProductCategoryViewModel category)
{
if
(ModelState.IsValid)
{
var services =
new
ProductCategoryServices(db);
services.Update(category, ModelState);
}
var result = db.ProductCategories.ToTreeDataSourceResult(request,
cat => cat.ProductCategoryId
, cat => cat.FKParentProductCategoryId
, cat => cat.ToProductCategoryViewModel(request)
);
return
Json(category, JsonRequestBehavior.AllowGet);
// return Json(new[] { category }.ToTreeDataSourceResult(request, ModelState));
}
PS. Stupid question but where is edit post option? :)
Hi Team,
I am using kendo UI editor and image browser in MVC View in form of HTML. I have to upload an image. I have created one action method and bound to the upload function of image browser. When i upload, image gets saved to the location and after that an automatic thumbnail call goes to app which has a url and pass the path parameter which is the file name. In case of new file upload it pass the path value to undefined. In upload action i am returning json response in form of:
var json = new { name = Path.GetFileName(file.FileName),
type = "f",
size = file.ContentLength
};
return Json(json, "text/plain");
Thumbnail action method is the default action method of EditorImageBrowserController class which i am using.
Please let me know if i am missing anything or do i need to override thumbnail action. If yes please provide me example.
Thanks.
Hi,
Is it possible, that dataSource.sync(); causes a double postback if using a slow connection ?
It looks like that the client postback twice if the server doesn't reply within e.g. 15 seconds.
The code:
var dataSource = $("#" + gridname).data("kendoGrid").dataSource;
dataSource.sync();
Are there any good ways to prevent double postbacks using the kendo framework?
Thanks.
Hi,
I am trying to use the @Html.Kendo().Grid(Model) to generate a row template, but it doesn't do what I want... The code I have so far is:
@(Html.Kendo().Grid(todayFocus)
.Name(
"TodaysFocus"
)
.Columns(columns =>
{
columns.Template(c => { }).ClientTemplate(
" "
).Title(
"Today's Focus"
);
columns.Template(c => { }).ClientTemplate(
" "
).Title(
"Mid Day"
);
columns.Template(c => { }).ClientTemplate(
" "
).Title(
"End Dday"
);
columns.Template(c => { }).ClientTemplate(
" "
).Title(
"Plan"
);
columns.Template(c => { }).ClientTemplate(
" "
).Title(
"Target"
);
})
.RowTemplate(grid => @<text>
<td>@item.TaskName</td>
<td>@item.MidDay</td>
<td>@item.EndDay</td>
<td>@item.Plan</td>
<td>@item.Target</td>
</text>)
)
And what I am getting for each row is:
<
tr
>
<
td
colspan
=
"5"
> /<
td
>
<
td
>Task Name</
td
>
<
td
>10</
td
>
<
td
>20</
td
>
<
td
>30</
td
>
<
td
>40</
td
>
</
tr
>
Why am I getting the extra <td colspan="5"> and how do I get rid of it?
Thanks
Hi,
I'm using a user-defined template for grid, it looks fine in Chrome, but a red frame appears around the text box.
How to solve it?
Thanks.