This question is locked. New answers and comments are not allowed.
| Hi I am trying to add a custom column by using MVC1.0 with Telerik MVC1 library. I am using the code mentioned below: 1) I am getting the following error : Invalid expression term ')' on this line Line 101: columns.Template(up => {%>
Can anyone help me out in this regard???? 2) The second question is which controller's action would be called if i use this statement. If I want to change the controller name and its action name, what should i do? %=Html.ActionLink("Edit","Edit", new {id = up.ProfileID})%> <%=Html.Telerik().Grid<XploreVer2.Web.Models.DataObjects.UserProfile>() |
| .Name("Grid") |
| .DataKeys(keys => { keys.Add(up => up.ProfileID); }) |
| .Columns(columns => |
| { |
| columns.Bound(up => up.Username).Width(100); |
| columns.Bound(up => up.Password); |
| columns.Template(up => {%> |
| <%=Html.ActionLink("Edit","Edit", new {id = up.ProfileID})%> |
| <%}); |
| columns.Template(up => {%> |
| <%=Html.ActionLink("Delete","Delete", new {id = up.ProfileID})%> |
| <%}); |
| }) |
| .ClientEvents(events => events |
| .OnLoad("onLoad") |
| .OnDataBinding("onDataBinding") |
| .OnRowDataBound("onRowDataBound") |
| .OnRowSelected("onRowSelected") |
| .OnDataBound("onDataBound") |
| .OnError("onError") |
| ) |
| //.DataBinding(dataBinding => dataBinding.Ajax().Select("_ClientSideEvents_Ajax", "Grid")) |
| .Pageable(paging => paging.PageSize(4)) |
| .Sortable() |
| .Filterable() |
| .HtmlAttributes(new { style = "margin-bottom: 1.3em" }) |
| %> |
| <!-- Site Master Code --> |
| <body> |
| <div class="page"> |
| <div id="header"> |
| <div id="title"> |
| <h1>My MVC Application</h1> |
| </div> |
| <div id="logindisplay"> |
| <% Html.RenderPartial("LogOnUserControl"); %> |
| </div> |
| <div id="menucontainer"> |
| <ul id="menu"> |
| <li><%= Html.ActionLink("Home", "Index", "Home")%></li> |
| <li><%= Html.ActionLink("About", "About", "Home")%></li> |
| <li><%=Html.ActionLink("Client Events", "_ClientSideEvents_Ajax", "Grid")%></li> |
| <li><%=Html.ActionLink("Ajax Server Binding", "_AjaxBinding", "Grid")%></li> |
| <li><%=Html.ActionLink("Ajax Client Call", "_AjaxClientCall", "Grid")%></li> |
| </ul> |
| </div> |
| </div> |
| <div id="main"> |
| <asp:ContentPlaceHolder ID="MainContent" runat="server" /> |
| <div id="footer"> |
| </div> |
| </div> |
| </div> |
| <%= Html.Telerik().ScriptRegistrar() %> |
| </body> |