If you use ObjectDataSource than you have to write the update and select method in one class. Maybe you have to write a class directly for that GridView to delegate the update and select methods to other objects.
I think it would be useful for you:
[DataObject(true)]
public class SomeService
{
private Device d;
private YourUpdaterClass yuc;
public SomeService()
{
this.d = new Device();
this.yuc = new YourUpdaterClass();
}
[DataObjectMethod(DataObjectMethodType.Select, true)]
public List<YourType> Select()
{
return d.YourSelectMethod();
}
[DataObjectMethod(DataObjectMethodType.Update, true)]
public void Update(YourType yt)
{
yuc.YourUpdateMethod(yt);
}
}
And the ObjectDataSource:
<asp:ObjectDataSource
ID="ObjectDataSource1"
runat="server"
SelectMethod="Select"
TypeName="SomeService"
DataObjectTypeName="YourType"
UpdateMethod="Update">
</asp:ObjectDataSource>