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

How do you implement CRUD operations on a Telerik RadGrid that has a dynamic datasource?

1 Answer 497 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 23 May 2016, 06:09 PM

We are using dynamic datasources (tables) to populate a Telerik RadGrid. The user can pick a table name from a combobox dropdown. Once they've picked the table, the grid is generated with the appropriate columns.

We would have used the "Automatic Data Source operations", but we can't since the DataSourceID isn't being specified on the grid (we allowing the user to pick which table they want to view/edit).

From the Telerik documentation: The automatic data source operations only work when binding the grid to a declarative data source using the DataSourceID property of the grid. You must configure the data source so that it supports the automatic operations.

How can we implement CRUD operations on a Telerik RadGrid that has a dynamic datasource? We're able to view the data in the grid now, but we're unable to Edit it. I don't know how/where to make the code changes to allow the Edit function to be dynamic.

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 26 May 2016, 12:56 PM
Hi Matthew,

In order to implement the behavior you can use manual CRUD operations for the grid. Since the data source will be selected from a ComboBox you would know what data source should be updated in the UpdateCommand of the RadGrid.

Check out the following example that illustrates using manual CRUD operations for RadGrid.



Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Matthew
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or