This question is locked. New answers and comments are not allowed.
Hello,
i'm just playing around with Silverlight and Telerik controls. for now i have a RIA Service Demo Application. at the moment
i can't figure out how to bind my fk value to the grid.
the grid itself is bound to a service that receives all cars.
| //Displaying all cars in the grid |
| CarContext ctx = new CarContext(); |
| carGrid.ItemsSource = ctx.Cars; |
| ctx.Load(ctx.GetCarsQuery()); |
displaying the carmakers name works in code if i manually create a GridViewComboBoxColumn an bind it to the
data receiving from a seperate service.
| //Getting carmakers from a seperate carMakerService |
| GridViewComboBoxColumn carMakerSelect = new GridViewComboBoxColumn(); |
| carMakerSelect.HeaderText = "Carmaker"; |
| carMakerSelect.DataMemberBinding = new Binding("carmaker_id"); |
| carMakerSelect.DisplayMemberPath = "name"; |
| carMakerSelect.SelectedValueMemberPath = "id"; |
| carMakerSelect.ItemsSource = carMakerContext.Carmakers; |
| carMakerContext.Load(herstellerDal.GetCarMakerQuery()); |
| this.carGrid.Columns.Add(carMakerSelect); |
is this the only way to connect a fk to the grid if i only like to display the fk's value? can this be done in xaml too?
i think i'm missing something in general and it's not 100% telerik datagrid related. but perhaps you can show me the right direction. :)
regards