1

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; }
}
faldeland
  • 587
  • 6
  • 20
  • Can you show more code? Like your container for the GridColumn and what your ItemsSource is? – TrueEddie Jul 18 '13 at 14:16
  • I have added container and ItemsSource – faldeland Jul 18 '13 at 14:27
  • I'm not familiar enough with that third party control. But according to this link http://stackoverflow.com/questions/4511619/wpf-bind-to-indexer it should be possible with standard controls, so it may be a limitation of the DXGrid. – TrueEddie Jul 18 '13 at 14:51
  • I agree with you. I believe the control authors need to chime in. I hope they answer my question as my year has run up. – faldeland Jul 18 '13 at 14:57

0 Answers0