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

Make RadGrid switch to read mode after inserting

2 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luis Silva
Top achievements
Rank 1
Luis Silva asked on 17 May 2010, 06:48 AM
I have a RadGrid where I am handling the event InsertCommand and doing the data insertion through a call to a BLL method (so no datasource is bound to the grid) the problem is after the insertion teh grid stays in insert mode, i want it to go back to list mode?

This is what I have:

void grid_InsertCommand(object source, GridCommandEventArgs e) 
        { 
            GridEditableItem eeditedItem = e.Item as GridEditableItem; 
            Dictionary<string, Object> newnewValues = new Dictionary<string, object>(); 
            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); 
            bool success = new SRA.Utils.GenericCodeBLL(TableName, DataKeyName, EnabledKeyName).Insert(newValues); 
             
            
            if (success) 
            { 
                //Display feedback message here 
                
                grid.MasterTableView.Rebind(); 
            } 

thanks


2 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 17 May 2010, 07:52 AM
Hi Luis,

After you are performing manual Insert operation, please try setting the AllowAutomaticInserts to false and see whether the insert form is getting closed when you click the Update button.

You may also test whether settings explicitly e.Item.OwnerTableView.IsItemInserted = false from within the InsertCommand handler makes a difference.

Greetings,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Luis Silva
Top achievements
Rank 1
answered on 17 May 2010, 08:01 AM
Hi Thank you very much, that fixed the issue, not sure why u have to set the AllowAutomaticInserts to false though...it does not make sense to me.

Thanks Again Luis
Tags
Grid
Asked by
Luis Silva
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Luis Silva
Top achievements
Rank 1
Share this question
or