This is a migrated thread and some comments may be shown as answers.

[Solved] Editing MasterDetail Grid shifts cells contents left

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andy
Top achievements
Rank 1
Andy asked on 15 Mar 2011, 02:43 PM
I have put together a master details grid, and I have added an edit button to the master record.  When I click the edit button the first cell (containing the arrow/plus for accessing the detail record) from the row I have clicked on is removed, thus movings all the other content left by one cell.

This does create the edit popup, and allows me to make change as expected, but if i click the cross at the top right of the edit popup the original grid remains broken.

Is this something that you are aware of? or have I done something wrong.

I am using
ASP.NET MVC 3
Windows 7
firefox/IE7/IE8
Telerik Product 2010.3.1318
C#

Code that demonstrates the problem.

 <% Html.Telerik().Grid(Model)
        .Name("Employees")
        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new { style = "margin-left:0" }))
        .DataKeys(keys => keys.Add(e => e.EmployeeID))
        .DataBinding(dataBinding => dataBinding.Server()
            .Select("Index", "Home")
            .Insert("Insert", "Home")
            .Update("Update", "Home")
            .Delete("Delete", "Home"))
        .Columns(columns =>
        {
            columns.Bound(e => e.FirstName).Width(140);
            columns.Bound(e => e.LastName).Width(140);
            columns.Bound(e => e.Title).Width(200);
            columns.Bound(e => e.Country).Width(200);
            columns.Bound(e => e.City);
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.Text);
                commands.Delete().ButtonType(GridButtonType.Text);
            }).Width(190).Title("Commands");
        })
        .DetailView(detailView => detailView.Template(e =>
        {
                    Html.Telerik().TabStrip()
                        .Name("TabStrip_" + e.EmployeeID)
                        .SelectedIndex(0)
                        .Items(items =>
                        {
                            items.Add().Text("Orders").Content(() =>
                            {
                               ViewData["EmployeeId"] = e.EmployeeID;
                               Html.RenderPartial("Orders", e.Orders);
                            });
                            items.Add().Text("Contact Information").Content(() =>
                            {
                                %>
                                    <div class="employee-details">
                                        <img src="<%= Url.Content("~/Content/Grid/Employees/" + e.EmployeeID + ".jpg") %>" alt="<%= e.FirstName + " " + e.LastName %>" />
                                        <ul>
                                            <li>
                                                <label>Birth Date:</label><%= e.BirthDate.Value.ToString("d") %>
                                            </li>
                                            <li>
                                                <label>Country:</label><%= e.Country %>
                                            </li>
                                            <li>
                                                <label>City:</label><%= e.City %>
                                            </li>
                                            <li>
                                                <label>Address:</label><%= e.Address %>
                                            </li>
                                            <li>
                                                <label>Home Phone:</label><%= e.HomePhone %>
                                            </li>
                                        </ul>
                                    </div>
                                <%
                            });                                                       
                        })
                        .Render();
        }))
        .Editable(editing => editing.Mode(GridEditMode.PopUp))
        .Pageable(paging => paging.PageSize(5))
        .Sortable()
        .Render();
    %>

1 Answer, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
answered on 21 Mar 2011, 12:16 PM
This has been resolved in version 2011.1.315.340 many thanks.
Tags
Grid
Asked by
Andy
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Share this question
or