Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ListView height inside of a StackPanel - problem...
Message
From
20/06/2008 13:01:19
 
 
To
20/06/2008 09:14:41
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01325263
Message ID:
01325800
Views:
13
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform