How do I implement many to many editing in radgrid using entity framework and declarative techniques? I have looked all over for examples.
my case is very simple with the following tables: Student, Class, StudentClass with StudentClass being strictly defined by Student.ID, and Class.ID
Entity framework turns this into Students with a Classes navigation property and Classes with Students navigation property.
In radgrid I want to display the classes for a given student, thus creating a localized master-detail or 1 to many view. unfortunately I can't pull it off, perhaps because not fully understanding the navigation properties and independent association, StudentClass.
I created an EntityDataSource against Students. I associated it with the StudentCourseRadGrid. in Master table View --> Columns, I have a bound ID (Student) column, and a dropdown Courses column. After that, things fall apart. Once I select the student, its id appears in the grid, but not his courses.
And then, of course, I want to be able to crud the StudentClass relationship. I fully expect to handle the radgrid_insert event which I have done easily in 1 to many scenarios.
this is the section giving me the most difficulty - it is wrong - very wrong.
I have tried many other permutations involving DataSourceID, ListTextField, ListValueField, and DataField, using Courses reversed with Students,without success. The only examples I have seen are hierarchical but I don't consider my situation hierarchical and it only confuses matters.
Any help is appreciated.
PS - after thinking about this, I believe that I tried to oversimplify the problem. 1 dataset is required to display the Student, 1 dataset - perhaps a navigation property though not sure how - is needed for the student's Classes, and 1 dataset is required to provide domain values for the StudentClass relationship should tuples be added. it will require more custom coding than wanted, but it is the logical, approach. I would be interested in something more efficient but for now I don't see it.
my case is very simple with the following tables: Student, Class, StudentClass with StudentClass being strictly defined by Student.ID, and Class.ID
Entity framework turns this into Students with a Classes navigation property and Classes with Students navigation property.
In radgrid I want to display the classes for a given student, thus creating a localized master-detail or 1 to many view. unfortunately I can't pull it off, perhaps because not fully understanding the navigation properties and independent association, StudentClass.
I created an EntityDataSource against Students. I associated it with the StudentCourseRadGrid. in Master table View --> Columns, I have a bound ID (Student) column, and a dropdown Courses column. After that, things fall apart. Once I select the student, its id appears in the grid, but not his courses.
And then, of course, I want to be able to crud the StudentClass relationship. I fully expect to handle the radgrid_insert event which I have done easily in 1 to many scenarios.
this is the section giving me the most difficulty - it is wrong - very wrong.
<telerik:GridDropDownColumn DataSourceID="Students" FilterControlAltText="Filter Materials column" HeaderText="Courses" ListTextField="Course.Name" ListValueField="Course.ID" UniqueName="Courses" DataField="ID"></telerik:GridDropDownColumn>
I have tried many other permutations involving DataSourceID, ListTextField, ListValueField, and DataField, using Courses reversed with Students,without success. The only examples I have seen are hierarchical but I don't consider my situation hierarchical and it only confuses matters.
Any help is appreciated.
PS - after thinking about this, I believe that I tried to oversimplify the problem. 1 dataset is required to display the Student, 1 dataset - perhaps a navigation property though not sure how - is needed for the student's Classes, and 1 dataset is required to provide domain values for the StudentClass relationship should tuples be added. it will require more custom coding than wanted, but it is the logical, approach. I would be interested in something more efficient but for now I don't see it.