我正在尝试将DataGrid
绑定到双打列表。我想要尝试做的是为这些双打设置自定义列标题(F1,F2,F3)。最终结果应如下所示。
-------------------------------------------
| F1 | F2 | F3 |
-------------------------------------------
| 12 | 15 | 25 |
-------------------------------------------
<DataGrid ItemsSource="{Binding Path=CFactors}"
AutoGenerateColumns="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Values" Binding="{Binding}" />
</DataGrid.Columns>
</DataGrid>
private List<double> cFactors = new List<double>
{
12,
15,
25
};
public List<double> CFactors
{
get { return cFactors; }
set
{
cFactors = value;
RaisePropertyChanged("CFactors");
}
}