Hi,
I'm trying to use the WebGrid to Update and Insert rows in a database using an ObjectDataSource. I created a very basic page using the information found in Infragistics Help located here. Binding WebGrid to an Object Data Source And I made sure all the checkboxes to create the Update, Insert, and Delete statements were checked.
I have set the DataKeyField property in both the UltraWebGrid and UltraGirdBand tags to the ID field for the table I'm trying to update. And I have set all the Allow Updating, Inserting and Adding properties to 'Yes'.
After doing this I'm able to compile and run the page and it displays the data in the table. I am able to press the add new row button and the grid displays a new blank row at the bottom of the grid. Here's where the problems begin. After entering data into the new row I've tried these methods.
If anyone here knows what I need to do to fix this error so I can update and insert with the WebGrid using an ObjectDataSource, I'd be most thankful for a response. I spent a lot of time looking for a simple example of updating and inserting using WebGrid with an ObjectDataSource but have but have been unable to find any sample code.
I'm using
I might have seen this same issue working with ObjectDataSources. Make sure the ultragrid.DataMember property is left blank. When I put the datatable name in this property I got the same error you're getting.
HTH
Jim
Hi "ddayagr",
Our team has run into the same problem. It appears it is a new issue with 8.2 (we didn't have the problem with 8.1). Here is how I "fixed" it:
I created my own class for ObjectDataSource to be used with the grid:
protected override DataSourceView GetView(string viewName) { return base.GetView("DefaultView"); }}
I use this instead of the regular ObjectDataSource and it is working so far (but as the name of the class suggests, this is more a like a hack then a real solution. There really seem to be an issue when using UltraGrid and an ObjectDataSource that returns a DataTable that is part of a DataSet (you don't get this problem when it's not part of a DataSet).
Hope this helps.