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
40
2008.1 grid & LinqDataSource problems
posted

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.

Parents
No Data
Reply
  • 92
    posted

     

    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.

Children