LinqDataSource '' does not support the Update operation unless EnableUpdate is true
because I forgot to add the following lines in the rowupdating event, which tells the grid that the event has been handled. Omitting these 2 lines causes the code to think that the update needs to be handled by the linqdatasource, which results in the above error
void MyGrid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { //Code to update, example: //int pb_pk; int.TryParse(Convert.ToString(e.Keys[0]), out pb_pk); //int pb_w3_Budget_fk; int.TryParse(Convert.ToString(e.NewValues["pb_w3_Budget_fk"]), out pb_w3_Budget_fk); //SqlDataProvider.PurchasingBudgets_Update(pb_pk, pb_w3_Budget_fk); e.Cancel = true; (sender as ASPxGridView).CancelEdit(); }
No comments:
Post a Comment