Hi!
I have the following lines in my _Layout.cshtml:
@Html.Kendo().AutoComplete().Name("search").DataTextField("Name").MinLength(3).Placeholder("Search...").DataSource(source => source.Read(read => read.Action("GetSiteInfos", "SiteInfo"))).AutoWidth(true).HtmlAttributes(new { style = "width: 50%;" }).Events(ev => ev.Select("onSiteSelect"))
and the Javascript for the selection is:
<script type="text/javascript">
function onSiteSelect(e) {
var selected = this.dataItem($(e.item));
var id = selected.Id;
$("#selectedSiteId").val(id);
}
</script>
It's working perfectly: the value of the field 'id' is stored in a HiddenField:
@Html.Hidden("selectedSiteId")
Now my problem is, that I have a TabStrip in this _Layout.cshtml and I would like to show some database results for the selected Id depending on the page I choose in the TabStrip.
@Html.Kendo().TabStrip().Name("siteTabStrip").Animation(animation => animation.Open(effect => effect.Fade(FadeDirection.In))).Items(tabstrip =>
{
tabstrip.Add().Text("First page").Content(@Html.Partial("_FirstPartial").ToHtmlString());
tabstrip.Add().Text("Second page").Selected(true).Content(@Html.Partial("_SecondPartial").ToHtmlString());
}).HtmlAttributes(new { @class = "k-state-active" })
How can I pass the hidden field value to the TabStrip item? Every TabStrip page will show a partial view. These partial views should call an action with the Id as a parameter and will show us different results from database. But this TabStrip will be rendered as soon as I load the page and before using the AutoComplete!
Thanks for your help.

| multiple custom group footer template names | |
I have my grid.
<div class="grid-scrollable">
<div>
@(Html.Kendo().Grid<ViewModels.Payment.BhFormExpenseRRViewModel>()
.Name("BHFormPATHRRGrid")
.Events(e => e.DataBound("dataBoundpath"))
.Events(e => e.Save("onBhFormpathModelGridSave"))
.Events(e => e.Edit("onBhFormpathModelGridEdit"))
.Columns(columns =>
{
columns.Bound(p => p.Id).Hidden(true);
columns.Bound(p => p.ECId).Hidden(true);
columns.Bound(p => p.ExpenseCategory).ClientFooterTemplate("Total Payment Requested")
.ClientGroupFooterTemplate("Total Expenses").EditorTemplateName("Decimal").Format("{0:c}");
columns.Group(g => g.Title("Current Month Expenses")
.Columns(a =>
{
a.Bound(c => c.ThisMonthPath).EditorTemplateName("Decimal").Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
.ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
a.Bound(c => c.ThisMonthMatch).EditorTemplateName("Decimal").Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
.ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
}));
columns.Group(g => g.Title("Reduced Monthly Expenses")
.Columns(a =>
{
a.Bound(c => c.ReduceExpensesBy).EditorTemplateName("Decimal").Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
.ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
a.Bound(c => c.CurrentMonthExpensesSubmitted).EditorTemplateName("Decimal").Title("AdjustedPathAmount").Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
.ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
}));
columns.Group(g => g.Title("Prior Month Expenses")
.Columns(a =>
{
a.Bound(c => c.PriorMonthMatch).Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
.ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
a.Bound(c => c.PriorMonthPath).Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
.ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
}));
columns.Group(g => g.Title("Cumulative Expenses YTD")
.Columns(a =>
{
a.Bound(c => c.YtdMonthMatch).Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
.ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
a.Bound(c => c.YtdMonthPath).Format("{0:c}").ClientFooterTemplate("#=kendo.toString(sum,'C')#")
.ClientGroupFooterTemplate("#=kendo.toString(sum,'C')#");
}));
columns.Command(command =>
{
command.Edit().HtmlAttributes(new { @class = "btn-primary k-grid-edit" });
}).Width(200);
})
.Editable(editable => editable.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
.Pageable(pageable => pageable.Refresh(true).PageSizes(true).ButtonCount(5))
.Sortable()
.Filterable(f => f.Operators(o => o.ForString(s => s.Clear()
.Contains("Contains")
.DoesNotContain("Does not contain")
.IsEqualTo("Is equal to")
.IsNotEqualTo("Is not equal to")
.StartsWith("Starts with")
.EndsWith("Ends with "))))
.Selectable()
.Resizable(resize => resize.Columns(true))
.DataSource(dataSource => dataSource.Ajax().PageSize(20).Model(model => model.Id(p => p.ECId)).Model(model => model.Field(p => p.TotalProirExpensesBilled).Editable(false)).Model(model => model.Field(p => p.CurrentMonthExpensesSubmitted).Editable(false)).Model(model => model.Field(p => p.TotalExpensesYtd).Editable(false)).Model(model => model.Field(p => p.ExpenseCategory).Editable(false))
.Model(model => model.Field(p => p.PriorMonthMatch).Editable(false)).Model(model => model.Field(p => p.PriorMonthPath).Editable(false)).Model(model => model.Field(p => p.YtdMonthMatch).Editable(false)).Model(model => model.Field(p => p.YtdMonthPath).Editable(false))
.Aggregates(aggregates =>
{
aggregates.Add(p => p.ThisMonthMatch).Sum();
aggregates.Add(p => p.ThisMonthPath).Sum();
aggregates.Add(p => p.PriorMonthMatch).Sum();
aggregates.Add(p => p.PriorMonthPath).Sum();
aggregates.Add(p => p.YtdMonthMatch).Sum();
aggregates.Add(p => p.YtdMonthPath).Sum();
aggregates.Add(p => p.ReduceExpensesBy).Sum();
aggregates.Add(p => p.CurrentMonthExpensesSubmitted).Sum();
})
.Update(update => update.Action("EditBHFormRR", "ReimbursementRequestProvider").Data("additionalInfoPath"))
.Events(events => events.Error("errorpath"))
.Group(groups => groups.Add(p => p.ExpenseTypeId))
.Read(read => read.Action("BHFromExpenseGridRead", "ReimbursementRequestProvider", new { bhFormName = Model.BHFormsName, reimbursementEbsId = Model.ReimbursementEbsId, prrId = Model.PrrId, rrState = @ViewBag.RRStateRequest, serviceMonth = Model.ServiceMonth }))
)
)
</div>
</div>
my requirement is
change group client footer of group 1 to "Total Payment Requested" instead of "Total Expenses"
change group client footer of group 2 to "Total Match Claimed" instead of "Total Expenses"
TOTAL OF TOTAL AS "Total Billing Submitted" instead of "Total Payment Requested"
the issue is I have name the group client footer on custom basis.
example group 1 sum footer name should be something different than group 2 sum footer name.
can any one help me on this please?

Hi Team ,
I am trying to add Kendo dropdownlist as part of Grid one grid column using EditorTemplates and it was successfully added but it was not binded to model and it was not reflect in cell which is selected from kendo dropdownlist.
I am usinh MVC5 and Kendo version 2015.1.429
Here is my code
.Grid<TEData.Model.Gen_Lists>().Deferred()
.Name("grdGen")
.Columns(cl =>
{
cl.Bound(u => u.TED_ENT_DATA_DAY_GEN_ID).Hidden(true);
cl.Bound(u => u.hourEnding).Width("10ex");
cl.Bound(u => u.actual).Width("10ex").Title("Actual");
//cl.Bound(u => u.Actual_Reason.reasonName).Title("Reason").EditorTemplateName("ReasonEditor").ClientTemplate("#:Actual_Reason.reasonName #");
cl.Bound(u => u.Actual_Reason).Title("Reason").ClientTemplate("#:Actual_Reason.reasonName #");
cl.Bound(u => u.actual_Reason_Notes).Title("Notes");
cl.Bound(u => u.totalCapacity).Title("Total Capacity").Width("10ex");
cl.Bound(u => u.totalCapacity_Reason.reasonName).Title("Reason").EditorTemplateName("ReasonEditor").ClientTemplate("#:totalCapacity_Reason.reasonName #");
cl.Bound(u => u.totalCapacity_Reason_Notes).Title("Notes");
cl.Bound(u => u.runState).Title("Run State").Width("10ex");
cl.Bound(u => u.runState_Reason.reasonName).Title("Reason").EditorTemplateName("ReasonEditor").ClientTemplate("#:runState_Reason.reasonName #");
cl.Bound(u => u.runState_Reason_Notes).Title("Notes");
//cl.Bound(u => u.reasonlist).ClientTemplate("#: reasonlist.reasonName#");
//cl.Bound(u => u.reasonlist.reasonCode).EditorTemplateName("ReasonEditor").ClientTemplate("#:reasonlist.reasonName #");
})
.Sortable()
//.Scrollable()
.Editable(ed => ed.Mode(GridEditMode.InCell))
.DataSource(ds =>
{
ds.Ajax()
.Batch(true)
.ServerOperation(false)
.Model(
m => {
m.Id(u => u.TED_ENT_DATA_DAY_GEN_ID);
m.Field(u => u.hourEnding).Editable(false);
//m.Field(u => u.reasonlist).DefaultValue(ViewData["defaultReason"] as TEData.Model.Gen_Lists);
}
)
.Read(rd => rd.Action("Get_Data", "TECommon")
.Data("userInput")
);
})
EditorTemplates Code
@model TEData.Model.ReasonCode_Lists
@(Html.Kendo()
.DropDownListFor(m => m.reasonName)
.Name("ddlEditor")
.DataTextField("reasonName")
.DataValueField("reasonCode")
.DataSource(d=>d.Read(r=>r.Action("Get_Reason_Codes", "TECommon")))
)
I have tried some sample from telerik and it was not helped me. Please help me
http://demos.telerik.com/aspnet-mvc/grid/editing-custom
Thanks,
Vetri.


Hi Team,
Currently I am using Kendo version 2015.1.429 and I am not able to find the Databound event for Kendo combobox
Please advise?
Thanks,
Vetri.
I am having a Kendo Grid (in MVC) with one cell highlighted in red/green color. When I do excel export, I am not getting the grid cell color exported to excel. Is there any workaround for getting the color displayed.
Also the dollar values in the grid are not getting exported to excel and pdf when exporting. Please provide solution for this too.
I have two questions on Kendo Grid Export (using ASP.Net MVC)
1) I have 2 kendo grids on a single ASP.NET MVC page. I wanted to export data from both the grids to a single worksheet in excel.
As per the below code, data is getting exported to two worksheets (2 tabs) in a single excel file. I wanted to have the data displayed in a single worksheet instead of 2 worksheets.
var sheets = [
productsWorkbook.sheets[0],
ordersWorkbook.sheets[0]
];
sheets[0].title = "XXX_DataView";
sheets[1].title = "YYY_DataView";
var workbook = new kendo.ooxml.Workbook({
sheets: sheets
});
kendo.saveAs({
dataURI: workbook.toDataURL(),
fileName: "XXX_YYY_DataView.xlsx"
2) Is there any limit on data export to PDF. We have difficulty in exporting more than 6000 rows of data to PDF. Please let us know how we can get this resolved.
Appreciate your faster response. Thanks!
Hello guys!
I have a little question but before posting source code I will just try to explaion. Basically I have a Grid with a foreign key. Everything works fine but on the same screen I have a dialog that updates the table which holds the foreing key values.
Let's say I have a Group with Id and Name. The Ids are loaded in the Grid and everything is fine. I can change the Names from outside the gird but when I refresh the Grid the group names are not updated.
I use $("#Grid").data("kendoGrid").dataSource.read(); to refresh the Grid. The other columns are refreshed, I see the loading indicator but the foreign key is not updated.
I would be grateful if anyone could help.
Regards,
Kaloyan Manev
<td class="" role="gridcell" data-role="editable"> <input type="hidden" value="" name="AffectedItems[0].Title"></td><td class="" role="gridcell" data-role="editable"> Item 1 <input type="hidden" value="Item 1" name="AffectedItems[0].Title"></td>@(Html.Kendo().Grid(Model) .Name("AffectedItems") .ToolBar(tools => tools.Create().Text("Add Affected Item")) .Editable(editable => editable.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Top)) .Columns(columns => { columns.Bound(p => p.Title).ClientTemplate("#= Title #" + "<input type='hidden' name='AffectedItems[#= index(data)#].Title' value='#= Title #' />" ).EditorTemplateName("AffectedItemsEditor"); columns.Bound(p => p.Id).Hidden().ClientTemplate("#= Id #" + "<input type='hidden' name='AffectedItems[#= index(data)#].Id' value='#= Id #' />" ); columns.Command(command => command.Destroy()).Width(100); }) .DataSource(dataSource => dataSource.Ajax() .Model(model => { model.Id(p => p.Id); model.Field(p => p.Id).Editable(false); }) .ServerOperation(false) ))<script> function index(dataItem) { var data = $("#AffectedItems").data("kendoGrid").dataSource.data(); return data.indexOf(dataItem); } function filterAffectedItems() { return { itemFilter: $("#AddAffectedItem").data("kendoComboBox").input.val() }; }</script>@(Html.Kendo().ComboBox() .Name("AddAffectedItem") .Placeholder("Choose One...") .DataTextField("Text") .DataValueField("Value") .MinLength(3) .Filter(FilterType.Contains) .AutoBind(false) .DataSource(dataSource => dataSource .Read(read => read.Action("GetAffectedItemsList", "AffectedItems") .Data("filterAffectedItems")) .ServerFiltering(true) ))public class AffectedItemsController : Controller { public JsonResult GetAffectedItemsList(string itemFilter) { var items = new List<SelectListItem>(); for (int i = 1; i <= 60; i++) { items.Add(new SelectListItem { Value = i.ToString(), Text = "Item " + i.ToString() }); } items.Add(new SelectListItem { Value = "Desktop", Text = "Desktop" }); if (!String.IsNullOrEmpty(itemFilter)) return Json(items.AsEnumerable().Where(i => i.Text.Contains(itemFilter)).Take(50), JsonRequestBehavior.AllowGet); return Json(items.AsEnumerable().Take(50), JsonRequestBehavior.AllowGet); } }
Hello,
I have a grid that when there is an update via SignalR all of the clients that the update is sent to scrolls to the top.
I have attached a gif of the issue the window on the right is what the other clients see
