Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
WebDataGrid 15.1 - Problems adding and editing rows
posted

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!