This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I need an advice.
I'm trying to use web control GridView with object data source. As we are using ID columns as identity columns. ID attribute is read only by Lightspeed design. GridView, for some reason, needs ID it to be settable.
How would you solve that problem in most simplistic way?
Thank you.
|
|
|
Are you using 2.1 RTM or a nightly build? We made a tweak to Entity post-2.1 to resolve this (labelling the Id property as a primary key with the DataObjectFieldAttribute) to enable the use of LightSpeed entities with GridView and the ObjectDataSource. This is working in our testing, so please try the nightly build and let us know if you still see a problem. |
|
|
Hi,
I'm using the 2.2 version (2.2.1105.11193 ) , but I'm getting the above error. I also found the http://www.mindscape.co.nz/forums/Thread.aspx?PostID=2773 post and saw that you are using DataObjectField(true, true) in Entities, but the Id is still a read only field. But according to MS (http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdatasource.dataobjecttypename.aspx) the ObjectDataSource requires writable properties to update data.
Does LightSpeed supports ObjectDataSources without a problem? or What could be the reason to get the above error?
|
|
|
You can use ObjectDataSource with LightSpeed but you need to change some of the generated settings, as follows. Implement an update method with the following signature: void UpdateMyObject(int /* sc. identity type */ id, ...) where ... represents the fields of the object e.g. UpdateWidget(int id, string name, int size). Configure the ObjectDataSource to refer to this as its Update method. In the Properties window for the ObjectDataSource, make the following changes: * Clear the DataObjectTypeName * Change the OldValuesParameterForm to {0} (Be warned that the ASP.NET designer often tries to change these back to their incorrect values when you configure the data source, so watch out!) You may need to make similar steps for insert and delete. |
|
|
This is a very hard process and most of the time ASP.NET overrides the settings.
I think its really important to support ObjectDataSource for n-tier scenarios.Do you have plans to support ObjectDataSource out of the box in future versions ?
Thanks.
|
|
|
We don't plan to change core LightSpeed behaviours just to fit into the ObjectDataSource model, and unfortunately we're not aware of anything we could do to work around the hardwired behaviours that currently make ODS/LightSpeed integration fiddly. Our preferred approach would rather be to ship a LightSpeedDataSource which could be used as the DataSource for a GridView in place of an ObjectDataSource. We have done some work on this, but bringing it to release has not been a high priority as relatively few of our customers use LightSpeed in this way. We'll have a look at how to go forward with this, for example by releasing it as a community code project. Would something like that be useful to you? |
|
|
Hello Ivan, any news about LightSpeedDataSource? Thanks, Igor |
|