This question is locked. New answers and comments are not allowed.
I have a view model which looks somewhat like this
The RadDataGrid takes the Items as the ItemsSource, however, within the header (or even the cell contents) I want to show the Name property which I am unable to do so.
I have also set the view models as the DataContext of the page.
With the standard ListView, the ItemDataTemplate would work with the above Binding
public class MyViewModel{ public string Name { get; set; } public ObservableCollection<MyModel> Items { get; set; }}public class MyModel{ public string ItemName { get; set; } public int ItemId { get; set; }}I have also set the view models as the DataContext of the page.
<Grid:RadDataGrid x:Name="dataGridInventCostPrice" Grid.Row="1" ItemsSource="{Binding Path=ItemCostPrices}" Background="{StaticResource TelerikRadGridBackground}" AutoGenerateColumns="False"> <Grid:DataGridTemplateColumn> <Grid:DataGridTemplateColumn.Header> <TextBlock> <Run Text="Item " /> <Run Text="{Binding Name}" /> </TextBlock> </Grid:DataGridTemplateColumn.Header> <Grid:DataGridTemplateColumn.CellContentTemplate> <DataTemplate> <TextBlock> <Run Text="{Binding ItemId}" /> </TextBlock> </DataTemplate> </Grid:DataGridTemplateColumn.CellContentTemplate> </Grid:DataGridTemplateColumn> </Grid:RadDataGrid.Columns></Grid:RadDataGrid>