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

2 posts, 0 answers
  1. Matthew
    Matthew avatar
    3 posts
    Member since:
    May 2016

    Posted 23 May 2016 Link to this post

    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.

  2. Viktor Tachev
    Viktor Tachev avatar
    2501 posts

    Posted 26 May 2016 Link to this post

    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.

    Viktor Tachev
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top