This question is locked. New answers and comments are not allowed.
Hello,
we are trying to implement a GridViewComboBoxColumn in a telerik RadGridView. Our Silverlight project uses RIA services (latest November BETA) to communicate with the database.
The Grid uses a DomainDataSource gridSource as data provider with RIA services in the background. The data provider for all ComboBox controls in the GridViewComboBoxColumn is another DomainDataSource comboSource. We cannot get things to work, the comboboxes are either empty or we are getting errors when starting our app.
Here is the definition of our datasources:
The table we use in gridSource references comboSource via the property cdArtGroup1.ID. This is not a simple property,
cdArtGroup1is another entity object inside our article object, from which we need the property ID. comboSource references an articlegroup table with two properties: ID and Caption and is used to feed our comboboxes.
When we create a single RadComboBox in our form the combobox is filled and displayed correctly with ID and Caption of DomainDataSource comboSource. Here is a code that works:
Our gridView generates one combobox per row and should feed the property cdArtGroup1.ID to the DataMemberBinding property of the GridComboBox which additionally sets the properties ItemssSource, DisplayMemberPath and SelectedValueMemberPath.
This is how we are generating out GridComboBoxes:
The error message we get after starting our project is:
This code and other variations of this code are not working! So it seems that we are doing something wrong in accessing the properties.
Anyone help?
we are trying to implement a GridViewComboBoxColumn in a telerik RadGridView. Our Silverlight project uses RIA services (latest November BETA) to communicate with the database.
The Grid uses a DomainDataSource gridSource as data provider with RIA services in the background. The data provider for all ComboBox controls in the GridViewComboBoxColumn is another DomainDataSource comboSource. We cannot get things to work, the comboboxes are either empty or we are getting errors when starting our app.
Here is the definition of our datasources:
| <Controls:DomainDataSource x:Name="gridSource" AutoLoad="True" QueryName="GetCdArticle"> |
| <Controls:DomainDataSource.DomainContext> |
| <AmaliaRIAServices:AmaliaDomainContext/> |
| </Controls:DomainDataSource.DomainContext> |
| </Controls:DomainDataSource> |
| <Controls:DomainDataSource x:Name="comboSource" AutoLoad="True" QueryName="GetCdArtGroup1"> |
| <Controls:DomainDataSource.DomainContext> |
| </Controls:DomainDataSource.DomainContext> |
| </Controls:DomainDataSource> |
The table we use in gridSource references comboSource via the property cdArtGroup1.ID. This is not a simple property,
cdArtGroup1is another entity object inside our article object, from which we need the property ID. comboSource references an articlegroup table with two properties: ID and Caption and is used to feed our comboboxes.
When we create a single RadComboBox in our form the combobox is filled and displayed correctly with ID and Caption of DomainDataSource comboSource. Here is a code that works:
| <telerikInput:RadComboBox ItemsSource="comboSource" DisplayMemberPath="Caption"/> |
Our gridView generates one combobox per row and should feed the property cdArtGroup1.ID to the DataMemberBinding property of the GridComboBox which additionally sets the properties ItemssSource, DisplayMemberPath and SelectedValueMemberPath.
This is how we are generating out GridComboBoxes:
| <telerik:GridViewComboBoxColumn Header="Combo" UniqueName="ComboGrp1" DataMemberBinding="{Binding ID, ElementName=cdArtGroup1}" |
| ItemsSource="comboSource" SelectedValueMemberPath="ID" DisplayMemberPath="Caption"/> |
The error message we get after starting our project is:
| Unhandled Exception - Code 4004 |
| Category: ManagedRunTimeError |
| Message: System.ArgumentException: Invalid property or field - "ID" for type:Char at |
| Telerik.Windows.Data.Expressions.MemberAccessTokenExtensions.Create...token,Expression Instance) |
| ... |
| ... |
| ... |
This code and other variations of this code are not working! So it seems that we are doing something wrong in accessing the properties.
Anyone help?