Hello, I'm using a WebDataGrid with default settings and additonally:
- DataSourceID is set to a SqlDataSource with parameterized Select, Update, Insert and Delete commands and a via ODP.NET connected Oracle Database
- EditingCore, RowUpdating, RowAdding and RowDeleting Behaviours enabled
- AutoCRUD property set to false, I implemented the RowUpdating serverside method to update the SQLDataSource with the provided parameters.
- DataKey property matches the 2 PrimaryKey Fields in the database.
- ReadOnly column settings set to true on 4 special columns (Create User, Date, Modify User, Modify Date) which are handled by database triggers
- I'm calling editingCore commit in the ExitedRowEditing event
Now, I'm facing the following three problems:
1) Editing does work fine, except when I want to edit a row which has null values in any of these 4 special columns (Create User, Date, Modify User, Modify Date). In that case, I cannot even exit the editing mode but am stuck forever. When the "Done" and "Cancel" buttons are enabled, I can cancel but Done has no effect and the ExitedRowEditing event is never called. Looks like the grid doesn't allow empty cellvalues in the RowEditing, even when they are set to readonly?
2) Inserting new rows does work - however, after the row is commited to the database, a sql trigger is setting the values for the create user, date, modify user and modify date columns. After the (ajax) postback, the new row does not show any values in these 4 columns until I reload the whole page.
Is there any possibility to reload the grid (or the updated or inserted row)?
3) When I update a primary key field in the grid, that works, however, when I then update any record a second time, I get the "Requested record cannot be found by key" exception. Maybe this has something to do with problem 2...that the grid should somehow be refreshed after updates?
I tried calling WebDataGrid1.DataBind() after the sqlDataSource.Update() call in RowUpdating event but that doesn't help.
HINT: I cannot set dataViewState to true for some reason (I get weird errors with that), so if possible I would need a solution without dataViewState.
Thanks a lot!
Hello Kevin,
The next service release is planned to be September, 2015. Also, the bug is fixed in the last available SR, which is 15.1.20151.2123, so could you please update your product, and let me know about the results, you may not have to wait until September.
Looking forward to hearing from you.
Hi Zdravko
Thanks a lot for your answer.Yes, commenting the date fields did indeed fix the problem. We are using the version 15.1.20151.1018.
Do you have any guess when the new serviceupdate will be released approximately?
Thanks again
Kevin
Hello,
Thank you for contacting us and for the detailed explanations!
About your last reply, yes this is correct, you should use RequestFullAsyncRender method. About point one from your first reply, a similar issue have been already reported and fixed and will be available in the next service release. This issue is caused by _areEqual method (because of the date columns). In order to be completely sure, could you please comment the Date columns 'in sake of the test' in order to check if truly the issue is related.
Also could you please let me know about your exact product version?
Looking forward for your reply.
Little update: It looks like I was able to fix the problem 3 and maybe problem 2 (need a bit more testing) by adding the following to the RowUpdating event:
WebDataGrid1.Rows.Clear();
WebDataGrid1.DataSource = SqlDataSource.Select(DataSourceSelectArguments.Empty);
WebDataGrid1.DataBind();
WebDataGrid1.RequestFullAsyncRender();
Looks like if DataViewstate is false and EnableAsync is true, you need to update the whole grid async. with the RequestFullAsyncRender() method.
Can you confirm that this is correct?
However, Problem 1 is still there.