Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF
how to find value from datagride in wpf
Posted 4-Oct-12 3: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 at 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
0 DamithSL 295
1 OriginalGriff 285
2 Sergey Alexandrovich Kryukov 157
3 Afzaal Ahmad Zeeshan 154
4 Peter Leow 115
0 OriginalGriff 7,510
1 DamithSL 5,494
2 Sergey Alexandrovich Kryukov 4,954
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2014
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