Click here to Skip to main content
Sign Up to vote bad
good
See more: WPF
how to find value from datagride in wpf
Posted 4 Oct '12 - 2:18


2 solutions

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  
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  
Comments
Kenneth Haugland - 4 Oct '12 - 9:28
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
Your Filters
Interested
Ignored
     
0 OriginalGriff 296
1 Mohammed Hameed 183
2 Sergey Alexandrovich Kryukov 143
3 Santhosh G_ 108
4 Mayur_Panchal 98
0 Sergey Alexandrovich Kryukov 8,216
1 OriginalGriff 6,271
2 CPallini 3,528
3 Rohan Leuva 2,703
4 Maciej Los 2,234


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