Hi - I'm trying to filter a grid that is bound to child tables using .Include() and .IncludeNext() and having no luck. I keep getting the error below - any help would be appreciated, I tried just about everything including gathering up all the SerialNumbers at a higher level but that was flakey code and causing a performance degradation.
Message"Invalid property or field - 'SerialNumber' for type: Invoice"string
Here's my data load statement:
invoices = from inv in _context.Invoices.Include(i => i.ShippingAddress).Include(i => i.InvoiceLines).ThenInclude(s => s.SerialNumbers)
where orgIds.Contains(inv.OwnedBy_Id) select inv;
And my filters:
$("#Grid").data("kendoGrid").dataSource.filter({
logic: "or",
filters: [
{
field: "SerialNumber",
operator: "contains",
value: searchValue
},
Thanks!
Craig
Hello,
I saw the demo here: http://demos.telerik.com/aspnet-core/grid/checkbox-selection
I'm trying to do the same, but I can't get it to work.
this is my code:
@(Html.Kendo().Grid<CalculationResultModel>()
.Name("Grid")
.Columns(columns =>
{
columns.Select().Width(50);
...
})
.Events(ev => ev.Change("onChange"))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(true)
.Model(model => model.Id(m => m.CalculationRequestIdentification))
.Read(read => read.Action("x", "x").Type(HttpVerbs.Get))
)
)
when I call the selectedKeyName() function in the javascript, I get an empty array.
Any Idea why that can be? The Id is a Guid btw.
Thanks!
Hello,
I'm having some grid's - some with paging or grouping (Expanded and Collapsed) where I want to search for a specific row (Model_Id) and
select that row (if it is a grouped row it should be expand)...
var dataItem = $("#grid").data("kendoGrid").dataSource.get(id);
but does this work also in a paged grid?
robert
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