DisplayMemberBinding when my ItemsSource is a List<string[]>
How do I bind DisplayMemberBinding
when my ItemsSource
is a List<string[]>
in my GridView?
EDIT: Figured it out! No need to answer. (开发者_如何学Cbinded to [i], where i is array index)
You can use-
<ListView ItemsSource="{Binding ListOfStringArrays}">
<ListView.View>
<GridView>
<GridViewColumn Width="140" DisplayMemberBinding="{Binding [0]}" />
<GridViewColumn Width="140" DisplayMemberBinding="{Binding [1]}"/>
<GridViewColumn Width="140" Header="Column 3" DisplayMemberBinding="{Binding [2]}"/>
</GridView>
</ListView.View>
</ListView>
精彩评论