This question is locked. New answers and comments are not allowed.
Hi Everyone,
First time posting in this Forum and appreciate any help. I am using the Telerik Grid in MVC3 with the Razor View Engine. I followed one of your examples for Ajax databinding. When I do not include an entry for ScriptRegistrar, the data loads and is pageable in the grid but filtering is not enabled (to be expected). Now to my main problem.. when I add '@Html.Telerik().ScriptRegistrar()' to the _Layout.cshtml code file, the filtering is enabled however when I try to page through the records I receive the following error : The requested URL returned 404 - Not Found.
Code Extract Controller:
Code Extract Index.cshtml
Any suggestions on how to resolve this issue?
Best regards - Les.
First time posting in this Forum and appreciate any help. I am using the Telerik Grid in MVC3 with the Razor View Engine. I followed one of your examples for Ajax databinding. When I do not include an entry for ScriptRegistrar, the data loads and is pageable in the grid but filtering is not enabled (to be expected). Now to my main problem.. when I add '@Html.Telerik().ScriptRegistrar()' to the _Layout.cshtml code file, the filtering is enabled however when I try to page through the records I receive the following error : The requested URL returned 404 - Not Found.
Code Extract Controller:
public ActionResult Index() { return View(GetClassifications()); } [GridAction] public ActionResult _AjaxIndex() { return View(new GridModel { Data = GetClassifications() }); } private IEnumerable<ClassificationViewModel> GetClassifications() { ContextFactory _factory = new ContextFactory(); var _entityClassification = _factory.GetDataRepository<tbl_AssetClassification>().ReadAll(); return from classifiction in _entityClassification select new ClassificationViewModel { ClassificationID = classification.Id, Classification = classification.Classification }; }Code Extract Index.cshtml
<fieldset> <!-- Telerik Grid Control--> <legend>Classifications</legend> @(Html.Telerik() .Grid(Model) .Name("Classifications") //.PrefixUrlParameters(false) .Pageable(pager => pager.PageTo(1).Position(GridPagerPosition.Bottom)) .DataKeys(keys => keys.Add(dataKeys => dataKeys.ClassificationID)) .ToolBar(ToolBarCommand => ToolBarCommand.Insert()) .NoRecordsTemplate("No Data could be retrieved from the database") .Columns(columns => { columns.Command(command => { command.Delete(); command.Edit(); }).Width(200).Title(""); //columns.AutoGenerate(true); columns.Bound(bound => bound.ClassificationID).Width(100); columns.Bound(bound => bound.Classification).Width(100); }).Editable(editable => editable.TemplateName("Classification").Mode(GridEditMode.PopUp)) .DataBinding(dataBinding => dataBinding.Ajax() .Select("_AjaxIndex", "Home") .Update("Update", "Home") .Insert("Insert", "Home") .Delete("Delete", "Home") ) .Groupable() .Sortable() .Filterable() ) </fieldset>Any suggestions on how to resolve this issue?
Best regards - Les.