I'm using the grid with the 'built in' editing.
When I call the Insert_Command my record is added.
But the grid still displays in edit mode.
I've tried e.item.edit = false in the code below but the insert does not work.
If I try
//condition for Insert Mode
if ((e.Item is GridEditFormInsertItem) && (e.Item.OwnerTableView.IsItemInserted))
{
GridEditFormInsertItem insertitem = (GridEditFormInsertItem)e.Item;
//this.RadGridPhone.MasterTableView.ClearEditItems();
e.Item.Edit = false;
}
The insert gets turned 'off' before inserting...
I've als tried
this.RadGridPhone.MasterTableView.ClearEditItems()
But that does noting...Any ideas ?? thanks
/// INSERT COMMAND
protected void RadGridPhone_InsertCommand(object source, GridCommandEventArgs e)
{
try
{
GridEditFormItem gridEditFormItem = (GridEditFormItem)e.Item;
Hashtable ht = new Hashtable();
gridEditFormItem.ExtractValues(ht);
//Create new row in the DataSource
DataRow newRow = this.Phone.NewRow();
newRow[
"PHONEEMAILORURL"] = ht["PhoneEmailOrURL"].ToString();
newRow[
"CONSTPHONEOREMAILTYPEID"] = ht["ConstPhoneorEmailTypeID"].ToString();
this.Phone.Rows.Add(newRow);
this.Phone.AcceptChanges();
this.RadGridPhone.DataSource = this.Phone;
this.RadGridPhone.DataBind();
}
catch (Exception ex)
{
this.RadGridPhone.Controls.Add(new LiteralControl("Unable to update/insert Phone Record. Reason: " + ex.Message));
e.Canceled =
true;
}
}