This question is locked. New answers and comments are not allowed.
Hi there,
In the following grid I am missing a route parameter in the URL used by the Edit-button in the grid. The route parameter appears after post-actions like Insert, but when the grid is rendered when loading the page, it does not work.
Situation: depending on a choosen value from a dropdown list box, the grid is filled with items in a certain context (the choosen value from the dropdown listbox). The .aspx file looks like this:
The value of ViewBag.DataSectionId is always known. When the grid is rendered, the URL of the Edit button is this:
/RefData/FooSentence/Index/1?RefFooSentence-mode=edit , and the URL of the Delete button is this:
/RefData/FooSentence/Delete/1?context=2 . The difference is that the Delete button has the route parameter context, but the Edit button does not.
When I hit Insert and Cancel, or Insert and Save, the URL of the Edit button is different:
/RefData/FooSentence/Index/1?Context=2&RefFooSentence-mode=edit
and the Delete button still has the same URL as before.
Is this a bug, or am I doing something wrong? I'm working with version 2011.1.322.340 of Telerik.Web.MVC.dll.
Then,
In the following grid I am missing a route parameter in the URL used by the Edit-button in the grid. The route parameter appears after post-actions like Insert, but when the grid is rendered when loading the page, it does not work.
Situation: depending on a choosen value from a dropdown list box, the grid is filled with items in a certain context (the choosen value from the dropdown listbox). The .aspx file looks like this:
<table border="0" cellspacing="0" cellpadding="0"> <tr> <td> Please select a set name to maintain the sentences for </td> <td> <%using (Html.BeginForm("Index", "FooSentence", FormMethod.Post, new { NoDialog = true} )) { var selectList = new SelectList(ViewBag.DataSections, "Id", "Name", ViewBag.DataSectionId); %> <%: Html.DropDownList("context", selectList) %> </td> <td> <button class="t-button t-state-default" type="submit">Apply</button> </td> <%}%> </tr> </table> <%: Html.ValidationSummary()%> <% Html.Telerik().Grid(Model) .Name("RefFooSentence") .DataKeys(keys => keys.Add(key => key.Id)) .DataBinding(databinding => databinding.Server() .Insert("Insert", "FooSentence", new { Context = ViewBag.DataSectionId }) .Update("Edit", "FooSentence", new { Context = ViewBag.DataSectionId }) .Delete("Delete", "FooSentence", new { context = ViewBag.DataSectionId }) ) .Editable(editable => editable.Mode(GridEditMode.InLine) ) .Columns(columns => { columns.Bound(c => c.Sentence); columns.Command(cmd => { cmd.Edit(); cmd.Delete(); }).Width(180).Title("Commands"); }) .ToolBar(toolbar => toolbar.Custom() .Text(string.Format("Add new {0}", ViewBag.DataSectionName ?? "")) .Action("Index", "FooSentence", new RouteValueDictionary { {"RefFooSentence-Mode", "insert"}, // Necessary for Telerik Grid to indicate its rendering... {"Context", ViewBag.DataSectionId} }) ) .Render(); %> The value of ViewBag.DataSectionId is always known. When the grid is rendered, the URL of the Edit button is this:
/RefData/FooSentence/Index/1?RefFooSentence-mode=edit , and the URL of the Delete button is this:
/RefData/FooSentence/Delete/1?context=2 . The difference is that the Delete button has the route parameter context, but the Edit button does not.
When I hit Insert and Cancel, or Insert and Save, the URL of the Edit button is different:
/RefData/FooSentence/Index/1?Context=2&RefFooSentence-mode=edit
and the Delete button still has the same URL as before.
Is this a bug, or am I doing something wrong? I'm working with version 2011.1.322.340 of Telerik.Web.MVC.dll.
Then,