Hi,
we've beeen waiting for NA 2008.1 to come out just to evaluate the anticipated support for LinqDataSource and now what we're seeing here is quite disappointing. Basically the grid seems to be read-only as it was with 2007.3.Scenario is as following:
* ASP.NET WebApplication in VS2008, browser IE6* simple table accessed from LinqDatasource, select * from it* Enable Insert, Update, Delete set for the LinqDataSource* LinqDataSource bound to the grid, DataKeyField for the band set to the table primary key, BaseTableName set to the table name in the dbml model, AJAX enabled, Allow Cell Updating enabled as well as row adding and deletion* Set Hidden=true in the grid band for the datasource properties representing relationships - 1 EntityRef and 1 EntitySet (also tried removing them from the band)* Added an empty event handler for UpdateRow as per suggestion found on this forum by one of your employees (also tried without, no change)
Result:when I edit a cell and move to another row, I see the "refresh" image superimposed showing that the grid is being updated on the database. Yet, no change in the database table itself. With a webgrid bound to a SqlDataSource (same table), repeating the same steps above, the update works and I can see rows changed in the database.Also my attempts with new row insertions and deletions yielded no results. I guess I'm missing something but documentation on your site seems to just skip this point, and the SDK samples too.
Can we please have some clear-cut directions on whether 2-way databinding with LinqDataSource is fully supported with the new 2008.1 WebGrid, and how to exactly accomplish basic CRUD operations in this scenario? So far the old, buggy, ugly, standard GridView is looking just so much better.
Thank you.
This is an issue with the LinqDataSource which we have reported to Microsoft. You will notice the same exception if you bind two asp:GridView controls to the same LinqDataSource.
Unfortunately due to the architecture of the UltraWebGrid this exception is raised when only one UltraWebGrid is on the page. Our research indicates that the LinqDataSource has trouble performing an update after it is bound. Unlike the GridView control, the UltraWebGrid does not send down the source data in viewstate so that the size of the markup is greatly reduced. As a result, when the UltraWebGrid loads postback data it needs to re-bind to the datasource before it can perform the update. It is this initial call to bind before calling update that causes the LinqDataSource to throw the exception.
We are not aware of any workaround for this issue, and are working closely with Microsoft to drive resolution of the LinqDataSrouce control bug.
Joseph, thanks for the answer.
Not exactly the answer we were hoping for (when it comes down to providing bugfixes quickly, we usually trust 3rd party developers much more than Microsoft itself), but at least it's quite clear where the problem is. Unfortunately seamless LinqDataSource support is absolutely instrumental to our current project, though we're still in the prototyping stage so we still have some time before committing to a final decision about the UI toolset to be employed.
For now I'll just mark this thread as answered and will try to monitor the issue in the future - not sure where to look for an announcement when the problem is solved, though.