Dear All,
Can you help me :)
I want to get value from dropdownlist in popup in grid.I have dropdownlist TransactionId,i want get automactically value in field outstanding Amount whatever in transaction id is primary key from outsatnding amount.
My view:
<div>
@(Html.Kendo().Grid<DevRedsMk3.Models.NpvCalculation>()
.Name("NpvCalculation")
.Columns(columns =>
{
columns.Bound(p => p.NpvCalculationId).Hidden();
columns.ForeignKey(p => p.TransactionId, (System.Collections.IEnumerable)ViewData["custTrans"], "TransactionId", "TransactionId").Title("TransactionId ID");
columns.Bound(p => p.LastPayment).Title("Last Payment");
columns.Bound(p => p.OutstandingAmount).Title("Outstanding Amount");
columns.Bound(p => p.Installment).Title("Installment");
columns.Bound(p => p.Interest).Title("Interest");//Title("Interest").Editable(false)
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(150);
columns.Command(c => c.Custom("OK").Text("OK").Click("OK"));
})
.ToolBar(toolbar =>
{
toolbar.Create();
})
.Events(e => { e.DataBound("onchangeevent"); })
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Scrollable(s => s.Height(570))
.Sortable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(datasource => datasource
.Ajax()
.ServerOperation(false)
.Model(model =>
{
model.Id(p => p.NpvCalculationId);
model.Field(p => p.Interest).Editable(false);
})
.Read(read => read.Action("List", "NpvCalculations"))
.Update(update => update.Action("Update", "NpvCalculations"))
.Create(create => create.Action("Create", "NpvCalculations"))
.Destroy(destroy => destroy.Action("Destroy", "NpvCalculations"))
)
)
<script type="text/javascript">
function OK(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
$.ajax({
url: "/NpvCalculations/GenerateNpvBaru",
//data: dataItem.id,
//data: { 'TransactionId': dataItem.TransactionId },
data: { TransactionId: dataItem.TransactionId },
success: function (response) {
//$('#viewDetails').html(response);
//alert('Approve done...');
}
});
}
</script>
<script>
function onchangeevent() {
$('#OutstandingAmount').val('10000');
}
</script>
</div>
Thanks for your help,
Regards,
Madeck
This is (in short) my Grid code:
@(Html.Kendo().Grid<Model>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.From).Format("{0:dd.MM.yyyy}").Width(150).Filterable(f => {
f.UI("DateTimeFilter");
f.Cell(cell => cell.ShowOperators(false));
});
})
.Filterable(filterable => filterable
.Extra(false)
.Operators(operators => operators
.ForString(str => str.Clear()
.Contains("Contains")
).ForDate( date => date.Clear()
.IsGreaterThan("After")
.IsLessThan("Before")
)
.ForNumber(number => number.Clear()
.IsGreaterThan("Higher than")
.IsLessThan("Lower than")
))
)
.Sortable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Read(read => //get some data)
)
)
The fact is that p.From is treated as a String (so he gets the filter of a string = .ForString(...)).
How is this possible? the format is also not aplied, but that works when i do this: .ClientTemplate("#= From? kendo.toString(kendo.parseDate(From), 'dd/MM/yyyy') : '' #")
Anybody expirienced this problmen yet?
I added a autocomplete control on a page. when I open the page as a popup the control works fine but when I open the page inside a master it is causing a javascript issue. When I debugged I found out that the control offset parent property is returning null. I am attaching the error. If someone can help that would be great.
Uncaught TypeError: Cannot read property 'left' of undefined
at c.DropDown._getDropDownHorizontalOffset ()
at c.DropDown.position ()
at c.DropDown._onDropDownReflowed ()
at b.DropDown.trigger ()
at b.DropDown.reflow ()
I have a groupable grid which contains more than 1000 rows. It takes a long time to load it, and what's more, it makes a browser works much slower. Sometimes it is almost impossible to scroll the grid because of the low performance.
So to reduce loading time and to improve scrolling flow I added a paging to the grid. (screen 1)
As the result, on the first page when I collapse the group my grid looks like on the screen 2.
It makes no sense to show it like this. I'd like to show the next group right behind the collapsed group,
like on the screen 3 (mock).
Can you give me a solution how can I solve it? Maybe you have any other idea?
If you give me an example how to improve the performance without injecting the paging - we're done.
We can think about Virtual Scroll as well, or even turning the filtering off on the client side - is it possible?
Hello,
I want to define which buttons are displayed in the toolbar in which not. In Kendo its possible by passing arrays to the sections of the toolbar (Home, Insert, Data). In .NET Core I am configurating the toolbar in my CSHTML file and can only pass booleans to the sections i.e. .Toolbar(t => t.Home(true).Data(false).Insert(false))
Btw. the documentation has a wrong description here: http://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/SpreadsheetBuilder#methods-Toolbar(System.Action%3CKendo.Mvc.UI.Fluent.SpreadsheetToolbarSettingsBuilder%3E) because it says I should pass a boolean (maybe just copied from the .Toolbar() above).
When I change the option after init in Javascript with "...options.toolbar.home = [['bold', 'italic'], 'format'];", the spreadsheet is not updated.
I really need a solution for this asap.
Why dropdown with bind to Enum and OptionLabel when initialized is set to first value of enum and not to OptionLabel
@Html.Kendo().DropDownListFor(model => model.Education).OptionLabel("Please choose...").BindTo(Html.GetEnumSelectList<MyProject.Models.Enums.Education>()).HtmlAttributes(new { style = "width:100%;" })
Here I have dropdown with option label as first row and Enum displaynames as following but control is set to first item from enum list.
In my case I set [Required] attribute for Education in module and I expect control stays at "Please choose..." and validation is not allow to save form without choosing value. But I get control set to first value so user can simply ignore this control
Hello Telerik Support Team (or to whom it may concern otherwise)
I have a boolean property bound to a Grid control column.
I would like to have a checkbox in that column that represents the boolean value of the model.
Here's a screenshot of how it currently looks (the 'Ja'/'Nein' is just a Client Template that i added temporarly, that one should be a checkbox)
Here's the screenshot:
https://i.imgur.com/ScvwCLo.png
Here's the code of the View:
https://pastebin.com/9WED8qAN
Here's the viewmodel behind the grid:
https://pastebin.com/gfY8d6dH
How can I do this?
Of course I googled around. But I only found javascript solutions that circumvented the usual asp.net core MVC logic. Plus none of the examples I found actually worked. So I'd like to know how I can do this in my particular case.
Thanks in advance.
And of course, if you need some more code, I can provide it on a need to know basis.
Hello,
With the following filter configuration how can I show a tooltip in the filter input that reflects the configured operator?
Column config:
columns.Bound(c => c.Reference).Filterable(f => f.Cell(c => c.Operator(
"equals"
).ShowOperators(
false
)));
Grid config:
.Filterable(f => f.Mode(GridFilterMode.Row))
The filter input markup would contain the following attribute:
title="Is equal to"
Thanks
I am using a ListView on .Net Core 2.0 the problem is the TagName attribute, no matter what i write inside it, it always render inside a div, here is my code, all works as expected except the TagName. The client template works, but i have <li> inside <div> instead of <ul>, html attributes render correctly.
Anyone knows where i am doing wrong?
@(Html.Kendo().ListView<MyModel>()
.Name(
"LV_Notifiche"
)
.TagName(
"ul"
)
.HtmlAttributes(
new
{ @
class
=
"dropdown-menu-list scroller"
, style =
"height: 250px;"
})
.ClientTemplateId(
"notificaTemplate"
)
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(
false
)
.Read(read => read.Action(
"Notifiche_Read"
,
"Notification"
))
)
.Deferred()
)