I'm populating a ListView from a SQL database. The listview has 3 columns defined into the XAML.
<ListView x:Name="lstAS7" Grid.Row="1">
<ListView.View>
<GridView>
<GridViewColumn x:Name="AS7Nom" Header="{DynamicResource AS7_Nom}" Width="350" DisplayMemberBinding="{Binding AS7_Nom}"/>
<GridViewColumn x:Name="AS7Lib" Header="{DynamicResource AS7_Lib}" Width="350" DisplayMemberBinding="{Binding AS7_Lib}"/>
<GridViewColumn x:Name="AS7Prix" Header="{DynamicResource AS7_Prix}" Width="80" DisplayMemberBinding="{Binding AS7_Prix}"/>
</GridView>
</ListView.View>
The code behind is the next one
foreach (DataRow valeur in ds.Tables["TB1"].Rows)
{
lstAS7.Items.Add(new { AS7_Nom = valeur["NAME"], AS7_Lib = valeur["TEXT_SHORT"], AS7_Prix = valeur["PRICE"] });
}
For the test I add a button to retrieve the content of the selecteditems and show it on the screen with a messagebox. This is the result.
{ AS7_Nom = "DVI_AT_HS_unit_07242802", AS7_Lib = "Set réservoirs de force ; Ht de meuble: 676 - 800mm ; pour système AVENTOS HS", AS7_Prix = 0 }
How can I retrieve the info from 1 column, for expl the column "AS7_Nom"