Click here to Skip to main content
12,450,977 members (23,174 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: WPF
how to find value from datagride in wpf
Posted 4-Oct-12 2:18am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Here:
http://social.msdn.microsoft.com/Forums/en/wpf/thread/a5fd5413-f055-4b56-83af-6d6bdb1d6fe9[^]

Its some task, if you want to do it from the DataGrid. Easyer to do it from the binding source.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

private void Window_Loaded(object sender, RoutedEventArgs e)
        {
           
            Process[] p = Process.GetProcesses();
            List<li> lst = new List<li>();
            foreach (Process ps in p)
            {
                li pp = new li();
                pp.NAME = ps.ProcessName.ToString();
                lst.Add(pp);
            }
           
            gv1.ItemsSource = lst;
        }
        public class li
        {
            public string NAME
            {
                get;
                set;
            }
        }
private void gv1_SelectionChanged(object sender, SelectionChangedEventArgs e)
       {
           MessageBox.Show(((li)e.AddedItems[0]).NAME);
       }
  Permalink  
v2
Comments
Kenneth Haugland 4-Oct-12 9:28am
   
Huh?!? Havent you shown a little too much code here?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100