Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My DataGrid is bound to an ObservableCollection<MyClass> called MyList.
C#
public class MyClass
    {
        public string _column1 { get; set; }
        public string _column2 { get; set; }
        public string _column3 { get; set; }
        List<Tuple<int, int>> referencedCells1;
        List<Tuple<int, int>> referencedCells2;
        List<Tuple<int, int>> referencedCells3;
    }


I am displaying only _column1, _column2, _column3 on the data grid. The referencedCells1,2,3 are a list of (row,column) values which I must highlight if a cell is clicked. So for example if I click on the first cell(0,0) - then the program has to highlight the cells referred to by MyList[0].referencedCells1. How do I do this - I am free to make changes to the Class structures as well.
Posted

You should be able to find that out by either my answer or by the use of XAML code here:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a5fd5413-f055-4b56-83af-6d6bdb1d6fe9/[^]
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 2-Apr-13 9:15am    
Typo fixed: "code".
If you don't mind.
—SA
Sergey Alexandrovich Kryukov 2-Apr-13 9:16am    
My 5; the article explains the idea.
—SA
Kenneth Haugland 2-Apr-13 9:20am    
Thanks, and I dont mind the edit :-)
rohith naik 4-Apr-13 2:32am    
Thanks Kenneth and SA for the edit, but i wanted to know the implementation in MVVM pattern and not in the event-driven programming model. I am sort of experienced in Winforms and already have the implementation in that(dataTable binding) but i am unable to wrap my head around the Commanding aspect of MVVM. Anyways My 4 for giving me the answer I deserve and not the answer I need :P

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900