Here is what I'm attempting to do...please advise if this is possible and how to achieve?
<dxg:GridColumn x:Name="FeatureAverage" FieldName="Datas[0].FeatureAverage" Width="75" Header="Avg" />
If I change the List Datas property to a single value (not a collection), the following works properly.
<dxg:GridColumn x:Name="FeatureAverage" FieldName="Data.FeatureAverage" Width="75" Header="Avg" />
Edit: This is a DevExpress DXGrid Control container and sample classes...
The entire grid is here...
<dxg:GridControl x:Name="gridControl1" ItemsSource="{Binding Reports}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,35">
<dxg:GridControl.Columns>
<!--Visible by default-->
<dxg:GridColumn x:Name="Name" FieldName="Name" Width="68" />
<dxg:GridColumn x:Name="Feature1" FieldName="Data.Feature1" Width="75" Header="Working" />
<dxg:GridColumn x:Name="Feature2" FieldName="Datas[0].Feature1" Width="75" Header="Not Working"/>
</dxg:GridControl.Columns>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<Custom:EventToCommand Command="{Binding GridLoadedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<dxg:GridControl.View>
<dxg:TableView Name="tableView1" ShowTotalSummary="True" />
</dxg:GridControl.View>
</dxg:GridControl>
public class MyViewModel
{
public ObservableCollection<Report> Reports { get; set; }
}
public class Report
{
public DateTime StartDateTime { get; set; }
public Single Duration { get; set; }
public Data Data { get; set; } //working with FieldName="Data.Feature1"
public List<Data> Datas { get; set; } //not working FieldName="Datas[0].Feature1"
}
public class Data
{
public byte Segment { get; set; }
public Single Feature1 { get; set; }
public Single Feature2 { get; set; }
}