Hello,
my problem is this: I created a website which contains a webdatagrid connected to an objectdatasource and should work with manual CRUD as shown in the video of Mr. Shoemaker. For the first time everything was ok. If the user changes cells in different rows and after that presses the "save" button the desired method "update..." was called and so the changes were written to the "database". FYI. it is an XML file.
Now it was necessary to add a few columns to the datagrid. For that I extended the data source and the functions as needed. After that I added the new columns to the datagrid and also extended the cell editing and row adding events as needed.
But now I have the problem that the method "update..." is not called if the "save" button is pressed. While testing and analyzing the problem I found that in rare cases the grid could be could be convinced to call the function to update the records if the user clicks in two other rows. But most the time nothing happens. it is definitely so that the update method is not called. I had a breakpoint at the beginning of that method and the debugger does not stop at this point.
One workaround I found is calling explicitly the _doPostback. But this results in a complete reload of the page. And this could not be the solution.
Yes the datagrid is inside of an update panel and Ajax of the grid is disabled.
I'm using the version=11.1.20111.2020.
Can anybody give me a hint? Thanks in advance.
Do you have the "DataKeyFields" property set in the WDG's smart tag?
Yes, I have set this property as you can see:
<ig:WebDataGrid ID="Wdg1" runat="server" Height="350px" Width="100%" AutoGenerateColumns="False" DataSourceID="ods1" DataKeyFields="Code" EnableAjax="False">
Hello martinn,
If you have disabled the AJAX of the grid then all Postbacks made for the events will be full Postbacks. Since your grid is embedded in the “UpdatePanel” every call made from within the panel should be executed as Async post. Something similar is explained here - http://encosia.com/easily-refresh-an-updatepanel-using-javascript/
You can also refer to this forum thread - http://community.infragistics.com/forums/p/53330/278998.aspx# - and download the sample attached there that shows how you can use the grid manual AutoCRUD.
Test this sample and let me know if you have additional questions.
Let me know if you have further questions.
Hello martin,
Thank you for your feedback. It will be helpful to other forum members as well.
No thanks, I've made a workaround. As the button has also a javascript function that provides that the webgrid indicator will be shown (do not know, why that does not appear automatically), I also call
"__doPostBack("<%= btnSave.ClientID %>", "");". Now the changes will be written to the file.