문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top