Controllercode:
01.
namespace
vEF_AspApplication.Controllers
02.
{
03.
public
class
AddressesController : Controller
04.
{
05.
private
MyDataModelContext db =
new
MyDataModelContext();
06.
07.
// GET: Addresses
08.
public
async Task<ActionResult> Index()
09.
{
10.
var addresses = db.Addresses.Include(a => a.FormOfAddress).Include(a => a.Title);
11.
return
View(await addresses.ToListAsync());
12.
}
13.
}
14.
}
Viewcode:
01.
@(Html.Kendo().MobileView()
02.
.Title("EntityFramework DataAccess")
03.
.Name("Index")
04.
.Content(@<
text
>
05.
<
div
id
=
"AddressList"
>
06.
@(Html.Kendo().Grid<
vEF_Library.Address
>()
07.
.Name("AddressGrid")
08.
.Columns(columns =>
09.
{
10.
columns.Bound(c => c.LastName);
11.
columns.Bound(c => c.FirstName);
12.
columns.Bound(c => c.Phone);
13.
})
14.
.HtmlAttributes(new { style = "height: 100%;" })
15.
.HtmlAttributes(new { style = "width: 100%;" })
16.
.Scrollable()
17.
//.Groupable()
18.
.Sortable()
19.
.Pageable(pageable => pageable
20.
.Refresh(true)
21.
.PageSizes(true)
22.
.ButtonCount(10))
23.
.DataSource(dataSource => dataSource
24.
.Ajax()
25.
.Read(read => read.Action("Index", "Addresses"))
26.
)
27.
)
28.
</
div
>
29.
</
text
>)
30.
)
What is wrong?
With the release of ASP.NET 5 beta 8 ...when we upgraded our MVC web application from 7 to 8 we ran into the following error.
Microsoft.AspNet.Diagnostics.DeveloperExceptionPageMiddleware: Error: An unhandled exception has occurred while executing the request
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
This was being caused by the Kendo.Mvc of reference of which we were using the 2015.3.930 release. We are wondering when will there be a release made that will be compatible with the latest beta release since the RC1 is supposed to be released in only a few short weeks from now and we are trying to keep our upgrade project rolling along with these releases.
We are hoping to not have to remove the reference and then switch our control usage from the wrappers back to coding everything in typescript. As this would cause us to have to refactor our controllers to remove the DataSourceRequest usages.
Thanks for any information you can provide.
AJ
Hi,
I have a Grid with batch editing. When I start to edit cell I have to capture the value of it (with changes made while editing) to send it to the controller.
How can I get this value? I have managed to get the cell itself with following javascript but it does not hold the value:
function cellData() {
var grid = $("#CustomerOrderPosition").data('kendoGrid');
var cellId = grid._cellId;
var cell = document.getElementById(cellId);
}
Greetings! I have a set of grids to export to Excel. I completed the first, with the help of your fine demo apps.
I have quite a bit of code for the OnExcelExport(e) event to set Excel column widths, cell colors, etc. For example:
//Set column width and wrap text
if (colIndex == 0) {
row.cells[colIndex].wrap = true;
sheet.columns[colIndex].autoWidth = false;
sheet.columns[colIndex].width = 63;
}
if (colIndex == 5 || colIndex == 6 || colIndex == 7) {
row.cells[colIndex].wrap = true;
sheet.columns[colIndex].autoWidth = false;
sheet.columns[colIndex].width = 72;
}
My question is :Is there a way to store metadata in the column definition of the grid that I can read in OnExcelExport(e) so that I can create shared, generic functions to set the Excel attributes or must I code each grid like this (referencing column order, etc.)? I tried stuffing attributes in the clientTemplate but this always seemed to affect my HTML grid...
Best,
Scott
If I have a treelist or grid with "popup" editing and an autosync datasource, how can I have the popup editor appear immediately for the new record?
It seems that with autosync, the create action is called immediately and no popup editor appears.
Ideally I would like the popup before going to the create action (same as without autosync).
It would be acceptable for the popup to appear after calling the create action on the server, so that it is editing a record filled with defaults.
Hi,
I have a chart which shows 3 lines. My client asks whether it is possible to have a background color between the lowest and highest line inside the area.
See the attachment for my example. The red lines mark the area which should be a light, gray color.
Any ideas?
Best,
Daniel
I have a combobox as a wrapper in MVC within a cshtml page. I need to modify the read.URL to build my url and supply the appropriate search criteria. I found a similar question and provided a link below to the answer, however this is using pure javascript and doesn't really fit my situation. How do i create a custom function in the .Read of the datasource so that i can build my url but do it with the MVC Wrapper? Also is there more detailed documentation with comments etc the api just shows you a very slim example for a feature and doesn't really document what is going on. Any help would be appreciated.
Link to answer that answers my exact question but i need the answer for the MVC Wrapper not javascript:
http://www.telerik.com/forums/how-do-i-specify-a-variable-in-the-middle-of-data-source-read#BPwmciunhUyELOSvZKBqIQ
var
grid = $(
"#Grid"
).data(
"kendoGrid"
);
$filter =
new
Array();
if
(contact ==
true
) {
$filter.push({ field:
"ContactDate"
, operator:
"neq"
, value:
null
});
grid.dataSource.filter($filter);