Hi,
I have a grid with a details template. I want to hide a column in the details template based on the value of a column from the main grid. Is this possible?
Thanks,
Cornel.

Hi,
I'm currently validating the UI for ASP.NET Core grid component and I run into an issue with the WebApi datasource. When trying the fetch the data it tries to find the data on endpoint "localhost:50050/Customers" however the endpoint is located at the endpoint "localhost:50050/api/Customers". I am following the examples listed here: "http://demos.telerik.com/aspnet-core/grid/webapi". In the demo the route is also configured at "api/{controller}".
Is there any special route configuration I need to add somewhere?
My "Index.cshtml" looks like:
<div class="main"> @(Html.Kendo().Grid<Customer>() .Name("customerGrid") .Columns(columns => { columns.Bound(c => c.Id).Title("Tenant"); columns.Bound(c => c.CompanyProfile.CompanyName).Title("Naam"); columns.Bound(c => c.CompanyProfile.Domain).Title("Domein"); columns.Bound(c => c.RelationshipToPartner).Title("Relatie"); }) .Scrollable() .Groupable() .Sortable() .Pageable(pageable => pageable .Refresh(true) .PageSizes(true) .ButtonCount(5)) .DataSource(dataSource => dataSource .WebApi() .Model(model => { model.Id(c => c.Id); }) .Read(read => read.Action("Get", "Customer")) ) )</div>My controller class:
public class CustomerController : Controller{ private readonly IAuthenticationService _authenticationService; private readonly ICustomerService _customerService; private readonly ISubscriptionService _subscriptionService; private readonly IUsageService _usageService; public CustomerController( IAuthenticationService authenticationService, ICustomerService customerService, ISubscriptionService subscriptionService, IUsageService usageService ) { if(authenticationService == null) throw new ArgumentNullException(nameof(authenticationService)); if (customerService == null) throw new ArgumentNullException(nameof(customerService)); if (subscriptionService == null) throw new ArgumentNullException(nameof(subscriptionService)); if(usageService == null) throw new ArgumentNullException(nameof(usageService)); _authenticationService = authenticationService; _customerService = customerService; _subscriptionService = subscriptionService; _usageService = usageService; } // GET: /<controller>/ public IActionResult Index() { return View(); } [HttpGet, Route("api/Customers")] public async Task<object> Customers([DataSourceRequest]DataSourceRequest request) { var customers = await _customerService .GetCustomersAsync(); return new { data = customers, totalCount = customers.Count }; }}

I am using Telerik Grid for Aspnet Core 2.0, but here my Actionresult "[DataSourceRequest]" can't be called, the browser says error message "The connection was reset".
Please find my code below:
Index.cshtml
-----------------
@(Html.Kendo().Grid<MVC6.Models.Blog>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.Title).Width(140);
columns.Bound(c => c.Description).Width(190);
})
.HtmlAttributes(new { style = "height: 380px;" })
.Scrollable()
.Groupable()
.Sortable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Customers_Read", "Blogs"))
)
)
BlogController.cs
-----------------------------------
// GET: Blogs
public async Task<IActionResult> Index()
{
return View("~/Views/Home/Index1.cshtml");
}
public IActionResult Customers_Read([DataSourceRequest] DataSourceRequest request)
{
return Json(GetBlogs().ToDataSourceResult(request));
}
private IEnumerable<Blog> GetBlogs()
{
return _context.Blog.Select(blog => new Blog
{
Title = blog.Title,
Description = blog.Description
}).ToList();
}

While populating a ComboBoxFor to be inside a grid, if the name of the view data variable is the same as the id, validation will be ignored.
View:
columns.ForeignKey(p => p.JobNo, (System.Collections.IEnumerable)ViewData["JobNo"], "JobNo", "JobNumber");Controller:
public IActionResult Index() {ViewData["jobnumber"] = _ddservice.GetAllOrdersByOfficeIdDD(oid); return View(); }

Hello,
I have the following grid with columns.AutoGenerate(true) :
@(Html.Kendo().Grid<dynamic>() .Name("gridEQ") .Columns(columns => { columns.AutoGenerate(true); }) .Pageable() .Sortable() .Scrollable() .Selectable(s => s.Mode(GridSelectionMode.Multiple)) .NoRecords() .Filterable(f => f.Enabled(false)) .AutoBind(false) .DataSource(dataSource => dataSource .Ajax() .PageSize(100) .Read(read => read.Action("Read", "Home")) ) )
If there is a query result from SQLServer with a column Name with spaces no rows are shown in the grid (the column Header is there)
see attached Picture
here is the json result:
{"Data":[{"Anzahl der Betriebsmittel":1376}],"Total":1,"AggregateResults":null,"Errors":null}
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
