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

Databinding a grid to a WCF Plain Service

1 Answer 35 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jörgen
Top achievements
Rank 1
Jörgen asked on 18 Apr 2013, 09:20 PM
I have created a N-Tier solution with a WCF Plain Service and OpenAccess ORM
I have a table containing two columns categoryid and categoryname

I have created a Windows Form with a Toolbar and a grid Control.

I can call the WCF service and get an Array of categories

I want to set the grids datasource to that Array and add new rows, update rows and delete rows and then save the Changes to the database. This doesn't work when the datasource is an Array.

I converted the Array to a BindingList and set this as the datasource.

Ran the Project and added a new row to the grid and tried to save the Changes to the database but this throws an exception.

I would like to have a working sample solution that accomplishes this.
I have looked at the SofiaCarRental sample but this is to complex

1 Answer, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 23 Apr 2013, 01:42 PM
Hello Jörgen,

According to the provided information, I would suggest you one of the following approaches:
1) Create a custom binding list that inherits from BindingList<T> and inside it to call the corresponding methods of the service. Information about the BindingList<T> class is available here.
2) Use the event handlers of the grid itself to call the necessary service methods
3) If the service is generated with the Add OpenAccess Service wizard, you could use the step-by-step tutorial provided with the SofiaCarRental - WCF Plain Services with Windows Forms sample as guide lines. You can open it by selecting the sample and clicking on the OpenDocumentation... command.

If you have additional questions, do not hesitate to get back to us.


All the best,
Doroteya
the Telerik team
Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
Tags
Data Access Free Edition
Asked by
Jörgen
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Share this question
or