Hello,
I am using a WebDataGrid with DataTable, I know the DataTable doesn’t support autoCRUD operations therefore I am manually handling this operations.
I am using a Oracle Data Base, retrieving my data, loading it into a DataTable, for this porpuse, I am using Oracle Data Provider for .NET from ODAC for visual studio 2010.
CRUD operations are performed in the database but does not reflect or update on the client side. I am binding the grid to the updated data source but that those changes cannot be reflected in the client side.
For example, in the event RowUpdating of WebDataGrid I am re-binding to the data source:
protected void GridViewWebFormDetails_RowUpdating(object sender, RowUpdatingEventArgs e){ //some code...
.
. //if update is TRUE then binding data WebDataGrid wdg = (WebDataGrid)sender; wdg.DataBind();}
Could you help me with an example using a DataTable as DataSource? I don't know what is happening with my project.
Please, Help!
Thanks,
Geovanny Domínguez
Hi Ivaylo,
Thank you for your response. Sorry for not responding, but I've recently resumed this theme. Your sample code and the video helped me a lot about how manual CRUD can be implemented.
Now, I want to do the same, but using UnBoundField type columns. I copied your example and I changed some parts of the code to try to achieve the goal, but after doing some CRUD operation on the data, at the end these are lost. (See sample code attached, Default2.aspx page)
Because I use the InitializeRow event, I guess this is not working properly, since it only works the first time and then not anymore. I have also tried with EnableAjax = False option (according to the video tutorial for Manual CRUD) and EnableAjax = True, but neither of these options work. I also think that the DataBind () method is no longer needed, but I expect your comments.
Could you help me, please? Thanks in advance!!!
Greetings,
Geovanny Domínguez.
If you have another questions or need clarifying regarding this matter, please do not hesitate to contact me!
Hello Geovanny,
Here is a code sample, showing how to bind a WebDataGrid to a DataTableSource. And another one using DataTableSource ManualCRUD operations. Notice that the Activation behavior is also enabled for the grid in order to ensure that the update operations are handled after a row has been added or edited. A video illustrating how manual CRUD can be implemented can also be found at:
http://www.youtube.com/watch?v=VxGoBSTvG7c