What im trying to do is have an edit button that instead of opening the line for editing, it forwards you to a page where you can edit. Is this possible? I tried something with the client template, but the grid render is ignoring it completely.
+1
A:
Yes, you can place a component into a grid column. Heres an example of how I bound the Id column with an Action link to the edit action passing in the Id.
I've removed the other columns from the template for clarity.
Html.Telerik().Grid(Model) .Name("Items") .DataKeys(keys => { keys.Add(x => x.Id); }) .Columns(columns => { columns.Bound(x => x.Id).Title("").Format(Html.ActionLink("edit", "Edit", new { id = "{0}" }).ToHtmlString()).Encoded(false).Width(60); }) .Render();
Kelly Ethridge
2010-10-25 22:38:45
Can i give the html.actionlink a css class?
John Stuart
2010-10-26 15:26:42
Sure. It uses the normal Html helper method so: Html.ActionLink("edit", "Edit", new { id = "{0}", @class="mycss" }
Kelly Ethridge
2010-10-26 17:14:41
I air coded the last comment. Updated: Html.ActionLink("edit", "Edit", new { id = "{0}"}, new { @class="mycss" })
Kelly Ethridge
2010-10-26 19:07:02