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

[Solved] Recommended approach when different data sources for edit and non edit modes

1 Answer 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 28 Jan 2010, 12:17 AM
Im a little confused as to what approach to take here.  I have a grid whos MastTableView uses bound columns and allowing auto edit/insert.  The datasource is an entity datasource (which uses a SQL Server View).  However, my edit/insert form obviously comes from a different datasource, and, multiple datasources at that.

Grid
   details > datasource1
   edit/insert form> datasource2
       listbox > datasource3
 
Should I connect the OnEditCommand for the grid and change its datasource accordingly?  I'm fine with doing this programmaticly, but not sure what approach to take.  Any good demos on this would be great or support articles.

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 02 Feb 2010, 08:30 AM
Hello Marc,

Basically, the control needs to have a consistent datasource, in order for all the relevant operations to be performed as expected. Changing its datasource in a dynamic manner is not a recommended approach.
One possible option in this case would be to use the ItemDataBound event handler, to get a reference to the items in the edit form, and set their datasources accordingly, or simply set their values.
I hope this is a feasible approach for you.

Best wishes,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Marc
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or