This question is locked. New answers and comments are not allowed.
Hi there,
i`ve got a problem with the Ajax Binding of the ASP.NET MVC Grid. I retrieve data from a WebService as a List<T> and bind this to the Grid. When the View is loaded, the Grid looks fine and the first 10 Rows are filled correctly, but when the User pages through the grid the data looses their format.
Here`s the Razor of the appropiate view with the Grid definition.
For example, the Column "Vorgangsart" shows the name of the transaction like Sales, GoodsReceipt, etc... but after paging only the Int-Values are shown. To illustrate this issue I attached the screeshots!
Here`s the code for the Ajax Binding in the Controller
I believe that it`s a JSON problem, but don`t know. I hope that someone can give me a tip on this. Thanks in advance.
i`ve got a problem with the Ajax Binding of the ASP.NET MVC Grid. I retrieve data from a WebService as a List<T> and bind this to the Grid. When the View is loaded, the Grid looks fine and the first 10 Rows are filled correctly, but when the User pages through the grid the data looses their format.
List<DocumentItemDto> data = ArticleHistoryProvider.GetDocumentItems(clienReportingRequest);return View("SearchResult", data);Here`s the Razor of the appropiate view with the Grid definition.
@(Html.Telerik().Grid(Model) .Name("Items") .Columns(columns => { columns.Bound(o => o.GTIN); columns.Bound(o => o.ArticleNumber).Title("Artikelnummer"); columns.Bound(o => o.BranchNumber).Title("Filiale"); columns.Bound(o => o.Currency).Title("Währung").Width(80); columns.Bound(o => o.DateTime).Format("{0:dd/MM/yyyy}").Title("Datum"); columns.Bound(o => o.ManufArticleNumber).Title("Hersteller"); columns.Bound(o => o.Quantity).Title("Menge"); columns.Bound(o => o.RetailPrice).Title("VK"); columns.Bound(o => o.Type).Title("Vorgang"); }) .DataBinding(dataBinding => dataBinding.Ajax().Select("AjaxBinding", "ArticleHistory")) .Scrollable() .Filterable() .Sortable() .Groupable() .Pageable(paging => paging.PageSize(10)) .Footer(true) )For example, the Column "Vorgangsart" shows the name of the transaction like Sales, GoodsReceipt, etc... but after paging only the Int-Values are shown. To illustrate this issue I attached the screeshots!
Here`s the code for the Ajax Binding in the Controller
#region AjaxBinding[GridAction]public ActionResult AjaxBinding(){ return View("SearchResult", new GridModel<DocumentItemDto> { Data = GetCachedData() });} #endregion #region GetCachedDataprivate IEnumerable<DocumentItemDto> GetCachedData(){ return Session[Cache] as IEnumerable<DocumentItemDto>;}#endregionI believe that it`s a JSON problem, but don`t know. I hope that someone can give me a tip on this. Thanks in advance.