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

[Solved] Pressing Cancel Edit Duplicates Columns

0 Answers 9 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.
Zero
Top achievements
Rank 2
Zero asked on 15 Oct 2012, 08:30 PM
Yeah. I can't quite explain why this happens. It's related to my drop down problem (I think) since when I press cancel I get a second helping of columns in the same row (it looks like the item template next to the edit template, complete with buttons and clipping issues), which include the drop down boxes, yet they don't show up when pressing the original edit button. It's rather strange. Here's some code:

@(Html.Telerik().Grid(Model.Milestones)
    .Name("MilestonesGrid")
    .DataKeys(x => { x.Add(p => p.Id); })
    .ToolBar(commands => commands
    .Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0" }))
    .DataBinding(binder =>
    {
        binder.Ajax()
            .Select("Details", "Milestones")
            .Insert("Create", "Milestones")
            .Delete("Delete", "Milestones")
            .Update("Edit", "Milestones");
        /*.Select("SelectAJAXMilestones", "Grid") .Insert("InsertAJAXMilestone", "Grid");
        .Delete("DeleteAJAXMilestone", "Grid") .Update("UpdateAJAXMilestone", "Grid");*
        /*Some more info needs to go here*/
    })
    .EnableCustomBinding(true)
    .Columns(columns =>
    {
        columns.Bound(x => x.Project_Id).Hidden();
        columns.Bound(x => x.Number);
        columns.Bound(x => x.Name);
        columns.Bound(x => x.Status_Id).Template(x => DropDowns.MilestoneStatus.Single(y => y.ID == x.Status_Id).Name)
            .ClientTemplate(Html.Telerik().DropDownList().Name("MilestoneStatusDDB<#= Status_Id #>").BindTo(new SelectList(DropDowns.MilestoneStatus, "ID", "Name")).ToHtmlString());
        columns.Bound(x => x.PlannedDate).Format("{0:MM/dd/yyyy}");
        columns.Bound(x => x.LatestEstimate).Format("{0:MM/dd/yyyy}");
        columns.Bound(x => x.MilestoneType_ID).Template(x => DropDowns.MilestoneType.Single(y => y.ID == x.MilestoneType_ID).Name)
            .ClientTemplate(Html.Telerik().DropDownList().Name("MilestoneTypeDDB<#= MilestoneType_ID #>").BindTo(
        new SelectList(DropDowns.MilestoneType, "ID", "Name")).ToHtmlString());
        columns.Command(commands =>
        {
            commands.Edit().ButtonType(GridButtonType.Text);
            commands.Delete().ButtonType(GridButtonType.Text);
        }).Title("Commands");
    }).Editable(edit =>
    {
        edit.Mode(GridEditMode.InLine);
        /*Some more info needs to go here*/
    })
    .Scrollable())
Tags
Grid
Asked by
Zero
Top achievements
Rank 2
Share this question
or