Question

I'm trying to use an ObjectDataSource bound to a Telerik RadGrid to perform automatic Select, Insert, Update and Delete. The OnSelecting method of the ODS refers to a method that is a member of MyClass, and returns a List. The OnUpdating method is also a member of that class and is annotated with [DataObjectMethod(DataObjectMethodType.Update, true)]

    [DataObjectMethod(DataObjectMethodType.Update, true)]
    public void updateMyClass(MyClass myClassToUpdate, string UserId)
    {
        BusinessLayer.updateClass(myClassToUpdate, UserId);
    }

The exception I'm getting indicates that the method should list the individual fields of the class. That's not how I'm used to doing this and some of my classes I'll be using have a large number of fields. Is this a Telerik or ObjectDataSource problem? Is there a setting for RadGrid or something else I'm missing that would allow me to pass the class in directly?

Steve

Was it helpful?

Solution

Need to set the DataObjectTypeName property in the ObjectDataSource. Do this and it will pass a class, however, the down side is that you can't add additional parameters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top