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

Inline Edit -- How to get rid of the insert row?

2 Answers 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Clint Leonard
Top achievements
Rank 1
Clint Leonard asked on 19 Aug 2010, 09:31 PM
I hate having to ask this as I am sure it is something simple, but I wanted to post it while I continue to look for the answer.

I am using inlione edit on my grid, and have a Command Item Bar to allow adding a new row to the grid.

The problem I am having is that after hittiing the 'PerformInsert' and rebinding to the grid, the new row still shows at the bottom of the grid.  

How can I make it go away once i hit 'Save' and rebind to the grid?

protected void rgACWF1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
    GridEditableItem editedItem;
    switch (e.CommandName)
    {
        case "Update":
            editedItem = (GridEditableItem) rgACWF1.EditItems[0];
            UpateACWFValue(editedItem, e);
            break;
        case "PerformInsert":
            editedItem = rgACWF1.MasterTableView.GetInsertItem();                    
            orgManager.SaveACWF1Value(AddACWFValue(editedItem, e));                                        
            break;
        case "Delete":
            editedItem = (GridDataItem) e.Item;
            Guid acwfValueID = new Guid(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID"].ToString());
            orgManager.DeleteAssetCriticalityWeightingFactorValue(acwfValueID);
            break;
    }

    rgACWF1.Rebind();
}

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Aug 2010, 05:29 AM
Hello Clint,

Check whether you have set AllowAutomaticInserts as true. If so set it as false and see if this solves the issue.

Thanks,
Princy.
0
Clint Leonard
Top achievements
Rank 1
answered on 20 Aug 2010, 02:25 PM
I knew it was going to be something simple. 

Works like a charm now.

Thank you!
Tags
Grid
Asked by
Clint Leonard
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Clint Leonard
Top achievements
Rank 1
Share this question
or