<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-6127132400597215190.post658150003039419606..comments</id><updated>2011-12-06T11:41:21.404-08:00</updated><category term='gadgets'/><category term='BlockZombies'/><category term='graphics'/><category term='HLSL'/><category term='XBLIG'/><category term='WP7'/><category term='music'/><category term='XML'/><category term='art'/><category term='game'/><category term='XNA'/><category term='networking'/><category term='Tunescape'/><category term='C#'/><category term='ld48'/><category term='unmanaged'/><category term='audio'/><category term='game design'/><category term='water'/><category term='TV3D'/><category term='wireless'/><category term='terrain'/><category term='Android'/><category term='WPF'/><category term='vista'/><category term='KFF'/><title type='text'>Comments on Nostatic Software Dev Blog: WPF ListView - Getting the Clicked Item</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.nostatic.org/feeds/658150003039419606/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html'/><author><name>Mike</name><uri>http://www.blogger.com/profile/13599208082890099005</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_1eC00ALSHt4/TQadQYzk0dI/AAAAAAAAFyY/KozsMa89wKA/S220/AvatarRetro2.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-8944662670169927622</id><published>2011-10-26T09:32:08.422-07:00</published><updated>2011-10-26T09:32:08.422-07:00</updated><title type='text'>Thank you for this post!</title><content type='html'>Thank you for this post!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/8944662670169927622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/8944662670169927622'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1319646728422#c8944662670169927622' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2003192718'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='October 26, 2011 9:32 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-4236209965161428932</id><published>2011-09-13T14:16:56.260-07:00</published><updated>2011-09-13T14:16:56.260-07:00</updated><title type='text'>No one is having a problem with the error &amp;quot;ex...</title><content type='html'>No one is having a problem with the error &amp;quot;expression of type &amp;#39;System.Windows.DependencyObject&amp;#39; can never be of type &amp;#39;System.Windows.Forms.ListViewItem&amp;#39;&amp;quot;??? I&amp;#39;m not sure what I&amp;#39;m doing wrong here...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/4236209965161428932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/4236209965161428932'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1315948616260#c4236209965161428932' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-413215303'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='September 13, 2011 2:16 PM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-5196119540059098618</id><published>2011-01-20T00:55:47.925-08:00</published><updated>2011-01-20T00:55:47.925-08:00</updated><title type='text'>Nice dude! That worked perfectly. :)
I am trying t...</title><content type='html'>Nice dude! That worked perfectly. :)&lt;br /&gt;I am trying to learn WPF and I had been struggling with this for days! &lt;br /&gt;Thanks!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/5196119540059098618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/5196119540059098618'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1295513747925#c5196119540059098618' title=''/><author><name>BR</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-766483655'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='January 20, 2011 12:55 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-4188112017801447928</id><published>2010-09-08T11:32:07.059-07:00</published><updated>2010-09-08T11:32:07.059-07:00</updated><title type='text'>TY  - helped my project</title><content type='html'>TY  - helped my project</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/4188112017801447928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/4188112017801447928'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1283970727059#c4188112017801447928' title=''/><author><name>sandhya</name><uri>http://www.blogger.com/profile/14507453099302083468</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-790738930'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='September 8, 2010 11:32 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-955562542107520012</id><published>2010-05-14T07:23:36.790-07:00</published><updated>2010-05-14T07:23:36.790-07:00</updated><title type='text'>I&amp;#39;m not sure if it would work in your case, Mi...</title><content type='html'>I&amp;#39;m not sure if it would work in your case, Mike, but this worked for me:&lt;br /&gt;        private void ListViewItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            ListViewItem listViewItemSender = sender as ListViewItem;&lt;br /&gt;            MyBusinessObject doubleClickedBO = myListView.ItemContainerGenerator.ItemFromContainer(listViewItemSender) as MyBusinessObject;&lt;br /&gt;        }</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/955562542107520012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/955562542107520012'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1273847016790#c955562542107520012' title=''/><author><name>René</name><uri>http://www.ignissoftware.dk</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-412619023'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='May 14, 2010 7:23 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-7345293719002532756</id><published>2010-04-12T02:30:15.629-07:00</published><updated>2010-04-12T02:30:15.629-07:00</updated><title type='text'>Very Good post!</title><content type='html'>Very Good post!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/7345293719002532756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/7345293719002532756'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1271064615629#c7345293719002532756' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-117951368'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='April 12, 2010 2:30 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-1073522724575045299</id><published>2009-12-04T20:33:21.873-08:00</published><updated>2009-12-04T20:33:21.873-08:00</updated><title type='text'>Great post!</title><content type='html'>Great post!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/1073522724575045299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/1073522724575045299'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1259987601873#c1073522724575045299' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-785739791'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='December 4, 2009 8:33 PM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-3826027891472744230</id><published>2009-12-02T10:45:42.366-08:00</published><updated>2009-12-02T10:45:42.366-08:00</updated><title type='text'>Or.. 


        private void appList_MouseDoubleCl...</title><content type='html'>Or.. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        private void appList_MouseDoubleClick(object sender, RoutedEventArgs e) {&lt;br /&gt;            ListViewItem app = (ListViewItem)appList.Items[appList.SelectedIndex];&lt;br /&gt;            MessageBox.Show(&amp;quot;you selected: &amp;quot; + app.Content);&lt;br /&gt;        }</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/3826027891472744230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/3826027891472744230'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1259779542366#c3826027891472744230' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-935832596'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='December 2, 2009 10:45 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-1849172701723258903</id><published>2009-09-30T08:19:50.993-07:00</published><updated>2009-09-30T08:19:50.993-07:00</updated><title type='text'>You can use this as well:

http://social.msdn.micr...</title><content type='html'>You can use this as well:&lt;br /&gt;&lt;br /&gt;http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/681dea50-6bd2-4676-8161-14416386778d</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/1849172701723258903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/1849172701723258903'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1254323990993#c1849172701723258903' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1085419049'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='September 30, 2009 8:19 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-286641836272143580</id><published>2009-01-11T17:03:00.000-08:00</published><updated>2009-01-11T17:03:00.000-08:00</updated><title type='text'>I'm assuming you mean to use a binding to TheSelec...</title><content type='html'>I'm assuming you mean to use a binding to TheSelectedItem, but anyway that wouldn't work in my particular case for at least two reasons:&lt;BR/&gt;&lt;BR/&gt;1. I'm using a multi-selected ListView (SelectionMode of Multiple), so SelectedItem is meaningless.&lt;BR/&gt;&lt;BR/&gt;2. I only want to act in response to mouse double-clicks, not selection.&lt;BR/&gt;&lt;BR/&gt;Responding to a selection is easy, but it isn't what I'm trying to do. In any case, if you want take action on a selection change, a better way to do that is to use the SelectionChanged event.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/286641836272143580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/286641836272143580'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1231722180000#c286641836272143580' title=''/><author><name>Mike</name><uri>http://www.blogger.com/profile/13599208082890099005</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp1.blogger.com/_1eC00ALSHt4/R1XswmXcsLI/AAAAAAAABDE/IbHIhFnBzws/S220/menu-small.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1411135018'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='January 11, 2009 5:03 PM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-2263656323768318402</id><published>2009-01-11T16:10:00.000-08:00</published><updated>2009-01-11T16:10:00.000-08:00</updated><title type='text'>That&amp;#39;s overly complex.&lt;br&gt;&lt;br&gt;Why would you do...</title><content type='html'>That&amp;#39;s overly complex.&lt;BR/&gt;&lt;BR/&gt;Why would you do that?&lt;BR/&gt;&lt;BR/&gt;If you have a listview, just do&lt;BR/&gt;&lt;BR/&gt;&amp;lt;ListView SelectedItem=&amp;quot;TheSelectedItem&amp;quot; ... &amp;gt;&lt;BR/&gt;&lt;BR/&gt;and in the setter for TheSelectedItem do what you want with it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/2263656323768318402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/2263656323768318402'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1231719000000#c2263656323768318402' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-313203140'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='January 11, 2009 4:10 PM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-7844887363672706311</id><published>2008-12-14T12:04:00.000-08:00</published><updated>2008-12-14T12:04:00.000-08:00</updated><title type='text'>Using&lt;br&gt;&lt;br&gt;MyDataItemType item = (MyDataItemType...</title><content type='html'>Using&lt;BR/&gt;&lt;BR/&gt;MyDataItemType item = (MyDataItemType)((ListViewItem)dep).DataContext&lt;BR/&gt;&lt;BR/&gt;instead of&lt;BR/&gt;&lt;BR/&gt;MyDataItemType item = (MyDataItemType)MyListView.ItemContainerGenerator.ItemFromContainer(dep);&lt;BR/&gt;&lt;BR/&gt;is a bit more straight forward but may only work, if data source binding is used for the list view.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/7844887363672706311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/7844887363672706311'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1229285040000#c7844887363672706311' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-97950571'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='December 14, 2008 12:04 PM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-2396935379589999174</id><published>2008-12-04T11:25:00.000-08:00</published><updated>2008-12-04T11:25:00.000-08:00</updated><title type='text'>hi&lt;br&gt;great code tnx!</title><content type='html'>hi&lt;BR/&gt;great code tnx!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/2396935379589999174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/2396935379589999174'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1228418700000#c2396935379589999174' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2053895996'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='December 4, 2008 11:25 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-8633327789606279540</id><published>2008-07-23T16:18:00.000-07:00</published><updated>2008-07-23T16:18:00.000-07:00</updated><title type='text'>Thanks a lot for this. Was searching around for ag...</title><content type='html'>Thanks a lot for this. Was searching around for ages and found yours to be the most concise method. Thanks</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/8633327789606279540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/8633327789606279540'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1216855080000#c8633327789606279540' title=''/><author><name>David</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1156340180'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='July 23, 2008 4:18 PM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-547958760640336876</id><published>2008-07-16T11:07:00.000-07:00</published><updated>2008-07-16T11:07:00.000-07:00</updated><title type='text'>As the last comment indicated, you need to handle ...</title><content type='html'>As the last comment indicated, you need to handle ContentElement's differently. If you hit a content element then you should get the logical parent.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/547958760640336876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/547958760640336876'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1216231620000#c547958760640336876' title=''/><author><name>Andrew Smith</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-211687973'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='July 16, 2008 11:07 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-8595736497805484853</id><published>2008-07-02T06:02:00.000-07:00</published><updated>2008-07-02T06:02:00.000-07:00</updated><title type='text'>This code fails if the OriginalSource is derived f...</title><content type='html'>This code fails if the OriginalSource is derived from FrameworkContentElemnt (e.g. anything in a FlowDocument, such as Document.Run). Unfortunately, VisualTreeHelper deals with Visual and FrameworkElement objects, but not FrameworkContentElement objects. 8-|</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/8595736497805484853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/8595736497805484853'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1215003720000#c8595736497805484853' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-184393847'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='July 2, 2008 6:02 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-1763962216723404345</id><published>2008-06-23T06:07:00.000-07:00</published><updated>2008-06-23T06:07:00.000-07:00</updated><title type='text'>Thanks for the info.  It worked great in my projec...</title><content type='html'>Thanks for the info.  It worked great in my project and helped me solve two issues I was having.  I really am starting to like WPF, but it is still taking a long time to figure it all out.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/1763962216723404345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/1763962216723404345'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1214226420000#c1763962216723404345' title=''/><author><name>Chester</name><uri>http://chesterscleanhouse.blogspot.com</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1313644682'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='June 23, 2008 6:07 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-1280231586035520312</id><published>2008-04-02T11:24:00.000-07:00</published><updated>2008-04-02T11:24:00.000-07:00</updated><title type='text'>Thanks much, you just saved me some time figuring ...</title><content type='html'>Thanks much, you just saved me some time figuring it out. Here is a VB version.&lt;BR/&gt; Dim clickedToDoItem As ToDoItemInfo&lt;BR/&gt;        Dim dep As DependencyObject = CType(e.OriginalSource, DependencyObject)&lt;BR/&gt;        Do While dep IsNot Nothing AndAlso Not TypeOf (dep) Is ListViewItem&lt;BR/&gt;            dep = VisualTreeHelper.GetParent(dep)&lt;BR/&gt;        Loop&lt;BR/&gt;        If dep Is Nothing Then&lt;BR/&gt;            Return&lt;BR/&gt;        Else&lt;BR/&gt;            clickedToDoItem = CType(Me.lvToDo.ItemContainerGenerator.ItemFromContainer(dep), ToDoItemInfo)&lt;BR/&gt;        End If&lt;BR/&gt;        MessageBox.Show(String.Format("You clicked item: date={0},description={1}", clickedToDoItem.Due, clickedToDoItem.Description))</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/1280231586035520312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/1280231586035520312'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1207160640000#c1280231586035520312' title=''/><author><name>Andreas</name><uri>http://www.dotnetjunkies.com/WebLog/azenker/</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1159677300'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='April 2, 2008 11:24 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-6987609794641747479</id><published>2008-02-27T06:32:00.000-08:00</published><updated>2008-02-27T06:32:00.000-08:00</updated><title type='text'>Try this and see how it works...&lt;br&gt; System.Data.D...</title><content type='html'>Try this and see how it works...&lt;BR/&gt; System.Data.DataRowView value = (System.Data.DataRowView)ListViewEmployeeDetails.SelectedValue;&lt;BR/&gt;               MessageBox.Show(value.Row[0].ToString());</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/6987609794641747479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/6987609794641747479'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1204122720000#c6987609794641747479' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1070683101'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='February 27, 2008 6:32 AM'/></entry><entry><id>tag:blogger.com,1999:blog-6127132400597215190.post-3730186343513225454</id><published>2008-01-31T04:59:00.000-08:00</published><updated>2008-01-31T04:59:00.000-08:00</updated><title type='text'>I saw how to get row or item, but how can I get co...</title><content type='html'>I saw how to get row or item, but how can I get column information from the mouse click position?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/3730186343513225454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6127132400597215190/658150003039419606/comments/default/3730186343513225454'/><link rel='alternate' type='text/html' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html?showComment=1201784340000#c3730186343513225454' title=''/><author><name>K.V</name><uri>http://www.blogger.com/profile/10029242018332057224</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.nostatic.org/2007/12/wpf-listview-getting-clicked-item.html' ref='tag:blogger.com,1999:blog-6127132400597215190.post-658150003039419606' source='http://www.blogger.com/feeds/6127132400597215190/posts/default/658150003039419606' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-949406994'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.displayTime' value='January 31, 2008 4:59 AM'/></entry></feed>
