protected void RadGrid1_InsertCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { GridEditFormItem item = (GridEditFormItem)e.Item; //Instantiate the model. using (NorthwindOpenAccessModel model = new NorthwindOpenAccessModel()) { //Get the primary key value using the DataKeyValue. int lastOrderID = int.Parse(model.Orders.Last().OrderID.ToString()); //Create the empty element that should be inserted. Order orderToAdd = new Order(); //Apply the vlaues from the editor controls. item.UpdateValues(orderToAdd); //Increment the PK field. orderToAdd.OrderID = ++lastOrderID; //Add the element. model.Add(orderToAdd); //Save the changes back to the datasource. model.SaveChanges(); } }