This is a migrated thread and some comments may be shown as answers.

Overriding SubmitChanges

4 Answers 47 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
plusHR
Top achievements
Rank 1
plusHR asked on 15 Dec 2011, 03:36 PM
When calling SubmitChanges I want to be able to pass a parameter into the SubmitChanges routine. Could you advise the best method of how to override this or how to create a new call on the RadDomainDataSource so that I can do some business logic, then submit the changes. Thus SubmitChanges(Enum.RunAuditRoutine)

Thanks
Paul

4 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 15 Dec 2011, 04:34 PM
Hi Paul,

The SubmittingChanges event will be called before they are sent to the server, i.e. before we call DomainContext.SubmitChanges().

You can't tamper with the changes made however because this will break the internal logic of RadDomainDataSource.

When the submit is finished you will receive the SubmittedChanges event, i.e. when the DomainContext invokes the callback method that we have passed in its SubmitChanges method.

I hope this helps.

Greetings,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
plusHR
Top achievements
Rank 1
answered on 15 Dec 2011, 04:39 PM
Thanks. When the data is passed back to the server I need to run some business logic workflow [which will adjust various status fields]. So when the data is passed back I would not know "what" workflow to execute prior to the Saving of the data to the database.

Thus Table1 could have different work-flows that need computing. Therefore I need to be able to pass a parameter back to the server which states the workflow function to use. Any ideas. Previously I would attach an entity and use that to work out the workflow, however this used to be added to the DomainContext option of the DomainDataSource where-as I don't believe that is supported in the RadDomainDataSource.

Thanks
P
0
Rossen Hristov
Telerik team
answered on 15 Dec 2011, 04:46 PM
Hello Paul,

I see.

Our RadDomainDataSource just like the stock MS DomainDataSource uses the DomainContext for everything it does.

So you can take the DomainContext instance that you assigned to the RadDomainDataSource.DomainContext property and do the same thing with this DomainContext.

I suppose that if you "piggy-back" an additional entity back to the server it would not cause any harm.

Can you try this and see how it goes?

Greetings,

Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
plusHR
Top achievements
Rank 1
answered on 15 Dec 2011, 04:58 PM
Yes sure, just wanted to see if there was a cleaner way to get a parameter back to the server from the client thus not having to piggy-back the additional entity.

P
Tags
DomainDataSource
Asked by
plusHR
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
plusHR
Top achievements
Rank 1
Share this question
or