Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListView height inside of a StackPanel - problem...
Message
De
20/06/2008 13:01:19
 
 
À
20/06/2008 09:14:41
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Divers
Thread ID:
01325263
Message ID:
01325800
Vues:
14
>Hey John - Once the user clicks on a row in the ListView, how do I get the key value of the customer they clicked on so I can call another Linq query to pull up further details or child records, etc?
XAML:
    <ListView Name="lv2" HorizontalContentAlignment="Stretch" 
              ScrollViewer.VerticalScrollBarVisibility="Visible" 
              SelectionChanged="lv2_SelectionChanged"
              SelectionMode="Single"
              Grid.Row="1">

C#:
   private void lv2_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
      dataitem d = (dataitem)e.AddedItems[0];  // dataitem being your entity class
      Debug.WriteLine(d.custno.ToString());
      }
Note the SelectionMode="Single" to turn off multi select.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform