Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 166301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:04:26+00:00 2026-05-11T12:04:26+00:00

I have the following ListView : <ListView Name=TrackListView> <ListView.View> <GridView> <GridViewColumn Header=Title Width=100 HeaderTemplate={StaticResource

  • 0

I have the following ListView:

<ListView Name='TrackListView'>     <ListView.View>         <GridView>             <GridViewColumn Header='Title' Width='100'                              HeaderTemplate='{StaticResource BlueHeader}'                              DisplayMemberBinding='{Binding Name}'/>              <GridViewColumn Header='Artist' Width='100'                               HeaderTemplate='{StaticResource BlueHeader}'                               DisplayMemberBinding='{Binding Album.Artist.Name}' />         </GridView>     </ListView.View> </ListView> 

How can I attach an event to every bound item that will fire on double-clicking the item?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:04:26+00:00Added an answer on May 11, 2026 at 12:04 pm

    Found the solution from here: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/3d0eaa54-09a9-4c51-8677-8e90577e7bac/


    XAML:

    <UserControl.Resources>     <Style x:Key='itemstyle' TargetType='{x:Type ListViewItem}'>         <EventSetter Event='MouseDoubleClick' Handler='HandleDoubleClick' />     </Style> </UserControl.Resources>  <ListView Name='TrackListView' ItemContainerStyle='{StaticResource itemstyle}'>     <ListView.View>         <GridView>             <GridViewColumn Header='Title' Width='100' HeaderTemplate='{StaticResource BlueHeader}' DisplayMemberBinding='{Binding Name}'/>             <GridViewColumn Header='Artist' Width='100' HeaderTemplate='{StaticResource BlueHeader}' DisplayMemberBinding='{Binding Album.Artist.Name}' />         </GridView>     </ListView.View> </ListView> 

    C#:

    protected void HandleDoubleClick(object sender, MouseButtonEventArgs e) {     var track = ((ListViewItem) sender).Content as Track; //Casting back to the binded Track } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following WPF ListView: <ListView Grid.Column=2 Grid.Row=1 Margin=0,53,12,6 Name=lvwProperties ItemsSource={Binding Path=SelectedPropertyItems, Mode=TwoWay} Grid.ColumnSpan=2>
I have the following layout. This defines a row in my ListView. I noticed
I have the following method GetData that creates a StreamReader from a file. private
I have a GUI application that has a ListView. It is used to show
I have a String countries[]. now when i click a button then on the
I'm trying to create something like a MDI tabbed Interface so I have a
Let's assume the following: Activity A calls Search Manager User searches, and search results
Alright, I'm just trying to learn about using Contact information, but I'm a bit
I am not expert in ASP so i would be appreciated for the help.
I'm pretty new to XAML, and my first task in a new job is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.