Hi guys.
I have a grid with 4 command buttons. I need to align the last one to the right. I try some ways I find on the support furum but I can't obtain my goal. Can you help me? This is my code:
</style>
.impExcel a { float: right; }
.impExcel { float: right; }
</style>
then...
@(
Html.Kendo().Grid<MCP310.Models.MCP_Detail>()
.Name("Grid_MCP_Detail")
.ToolBar(toolbar => {
toolbar.Create().HtmlAttributes(new { @class = (Model.idStatoRichiesta > 0 ) ? "k-button-outline-primary k-state-disabled" : "k-button-outline-primary k-state-default" });
toolbar.Save().HtmlAttributes(new { @class = "k-button-outline-primary"});
toolbar.Custom().Text("t").IconClass("k-icon k-i-file-excel impExcel").HtmlAttributes(new { @class = "k-button-outline-primary impExcel", @id = "btnImportExcel"});
})
.Columns(columns => {
.....Thanks
Cristian
I have the following in a .cshtml file:
@(Html.Kendo().Grid<TaxCertApp.ViewModels.ViewModel>()
.Name("FilingFeesGrid")
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:500px;" })
.AutoBind(false)
.Columns(columns =>
{
columns.Bound(s => s.DistributionDate).Format("{0:MM/dd/yyyy}").Width(100).EditorTemplateName("Date");
columns.Bound(s => s.Disbursed)
.Format("{0:C2}")
.EditorTemplateName("Disbursed")
.Width(100)
.ClientFooterTemplate("Total: #=sum#")
.HtmlAttributes(new { style = "text-align: right" })
.FooterHtmlAttributes(new { style = "text-align: right" });
columns.Bound(s => s.Received)
.Format("{0:C2}")
.EditorTemplateName("Received")
.Width(100)
.ClientFooterTemplate("Total: #=sum#")
.HtmlAttributes(new { style = "text-align: right" })
.FooterHtmlAttributes(new { style = "text-align: right" });
columns.Bound(s => s.CHECKNO).Title("Check Number").Width(100);
columns.Bound(s => s.DESCRIPTION).Title("Description").Width(300);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Aggregates(aggregates =>
{
aggregates.Add(p => p.Disbursed).Sum();
aggregates.Add(p => p.Received).Sum();
})
.Read(read => { read.Action("Fees", "Fees").Data("{ ID: " + @Model.ID + "}"); })
)
)
This generates a grid with 2 columns having sum aggregates. The format of those 2 columns is currency. How can I get the sum aggregates to display with the same currency format? I have included a picture of the rendered grid.
Question #2: How can I access the two aggregate sum's to display a "difference" number (the Disbursed sum - the Received sum)?

We have a page that contains a mvc kendo grid. This grid contains a detail template = all working as expected!
Also, on the same page there is a checkbox.
In our grid (below), and we want to switch SALES OUT and COST VALUE column groupings based on the checkbox being checked. Does the checkbox have to be a html checkbox or can we leave it as a .net checkbox and do this in the code behind?
I'm new to kendo so any help greatly appreciated. We are trialling it to see if ti fits our requirements.
Thanks Simon
@(Html.Kendo().Grid<Web_AllPFCs_BySMR_v5>() .Name("wpsbysmr") .Columns(columns => { columns.Bound(c => c.SMRCat).Title("Category").Width(150); columns.Group(g => g.Title("Sales Out").Visible(true) .Columns(costvalue => { costvalue.Bound(c => c.Avg1_Invoice).Width(100).Title("PPU Calendar YTD").Format("{0:£#,##0}"); costvalue.Bound(c => c.Avg2_Invoice).Width(100).Title("PPU Calendar PYTD").Format("{0:£#,##0}"); costvalue.Bound(c => c.Value1).Width(100).Title("Calendar YTD").Format("{0:£#,##0}"); costvalue.Bound(c => c.Value2).Width(100).Title("Calendar PYTD").Format("{0:£#,##0}"); costvalue.Bound(c => c.PFCDiffSale).Width(100).Title("Change").Format("{0:£#,##0}"); costvalue.Bound(c => c.PFCPercSale).Width(100).Title("Change %").Format("{0:0.0%}"); }) ); columns.Group(g => g.Title("Cost Value").Visible(false) .Columns(costvalue => { costvalue.Bound(c => c.Avg1_Cost).Width(100).Title("PPU Calendar YTD").Format("{0:£#,##0}"); costvalue.Bound(c => c.Avg2_Cost).Width(100).Title("PPU Calendar PYTD").Format("{0:£#,##0}"); costvalue.Bound(c => c.Cost1).Width(100).Title("Calendar YTD").Format("{0:£#,##0}"); costvalue.Bound(c => c.Cost2).Width(100).Title("Calendar PYTD").Format("{0:£#,##0}"); costvalue.Bound(c => c.PFCDiffCost).Width(100).Title("Change").Format("{0:£#,##0}"); costvalue.Bound(c => c.PFCPercCost).Width(100).Title("Change %").Format("{0:0.0%}"); }) ); }) .Scrollable(s => s.Height("auto")) .HtmlAttributes(new { style = "max-height:550px !important;" }) .Pageable(pageable => pageable .Refresh(true) .PageSizes(true) .ButtonCount(15)) .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("WPSBySMR", "Home")) .PageSize(10) ) .Events(e => e.DataBound("wpsbysmr_Databound")) .ClientDetailTemplateId("SMRCatDetails") )
Hi,
Would there be a way to interact with the Rating widget by setting a minimum and maximum value of 1, within a grid?
For example in this way:
columns.Bound(p => p.IsFavorite).Title("Is Favorite?").Width(140).Editable("returnFalse").ClientTemplate(Html.Kendo().Rating()
.Name("rating_#=ProductID#")
.Min(1)
.Max(1)
.Label(false)
.HtmlAttributes(new { data_bind = "value: IsFavorite" })
.Selection("single")
.ToClientTemplate().ToHtmlString()
);
I have tried but when I select the only star it no longer lets me deselect it
Any help would be greatly appreciated
Javier B.
How can we make sure optional field is not validated? Also the model is a DateTime? type.
i.Add()
.Field(x=>x.ProductionDate)
.Label(l => l.Text(Extensions.GetPropertyDisplayName<Detail_InfoForm_ViewModel>(x => x.ProductionDate)).Optional(true))
.Editor(e => e.DatePicker()
.HtmlAttributes(new { style = "width: 100%", title = "Production date" })
.DateInput()
);I am trying to pass selected value from dropdownlist(GameCode) to another dropdown(GameCode2).
It is passing the value but it is not showing the value in the another dropdown.
How can I show it?
function gameDropDownOnChange(e) {
var game= $('#GameCode').data("kendoDropDownList").value();
$('#GameCode2').val(game).change();
}
Hello,
Is it possible to prevent the automatic selection event when navigating in a combobox using the arrows keys, just like in the multiselect example here: https://demos.telerik.com/aspnet-mvc/multiselect/events ???

Hi Team,
We are facing problems in below scenarios, Request help on the same.
We have data based parent and their child nodes and it is binding properly however, we wanted to implement functionality like we need to display only parent node for their selected nodes. (currently, it is displaying all nodes including parents and their childs.)
Request help on the asap asap.
Hi All,
I have the kendo grid with group as below:
There are 2 groups
(1) Grant Name (want to count how many projects under the grant)
(2) Project Name (want to count how many items under the project)
I cannot get the count to show in each group header by using ClientGroupHeaderTemplate. My code below:
@(Html.Kendo().Grid<Grants.Models.ProjectView>()
.Name("InProgress")
.Columns(column =>
{
column.Bound(c => c.InvoiceDate).Title("Invoice Date").Width(130)
.ClientTemplate("#if (MultipleCategory == 0)"
+ "{#<a onclick=\"windowSingleProcess(#=ProjectReimbursementId#)\"><span style='color:blue; cursor:pointer;'>#= kendo.toString(InvoiceDate,'MM/dd/yyyy') #</span></a>"
+ "#}else"
+ "{#<a onclick=\"windowMultipleProcess(#=ProjectReimbursementId#)\"><span style='color:blue; cursor:pointer;'>#= kendo.toString(InvoiceDate,'MM/dd/yyyy') #</span></a>"
+ "#}#")
.ClientGroupHeaderTemplate("Count: #=count#");
column.Bound(c => c.VendorName).Title("Vendor name");
column.Bound(c => c.InvoiceNumber).Title("Invoice #");
column.Bound(c => c.GrantFundedTotal).Title("Grant Funds Requested").Width(150).Format("{0:c2}").HtmlAttributes(new { style = "text-align:right!important" });
column.Bound(c => c.ContributionFundedTotal).Title("Match").Width(150).Format("{0:c2}").HtmlAttributes(new { style = "text-align:right!important" });
column.Bound(c => c.BudgetCategory).Title("Budget Category");
column.Bound(c => c.ProcessedDate).Title("Process Date").Format("{0:d}").Width(130);
})
.Pageable()
.Sortable()
.Scrollable(s => s.Height("auto"))
.ColumnMenu()
.Mobile()
.DataSource(ds => ds
.Ajax()
.Batch(true)
.GroupPaging(true)
.Model(m => m.Field(x => x.ProjectReimbursementId))
.Group(g =>
{
g.Add(x => x.GrantName);
g.Add(x => x.ProjectName);
})
.Aggregates(ag =>
{
ag.Add(x => x.GrantProjectId).Count();
ag.Add(x => x.ProjectReimbursementId).Count();
ag.Add(x => x.InvoiceDate).Count();
})
.Read(read => read.Action("MyReimbursementInProgress", "ProjectReimbursement"))
)
Thank you for your help.
