Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
For Example

Java
Student
{
 Name
 List<Subject>
}

Subject
{
 GroupName
 SubjectName
 Grade
}


DataGrid/ListView be like
Subject              Student1    Student2    Student3 ..... Student n
---------------------------------------------------------------
Languages (GroupName)
  English              A            A+         -NA-
  French               -NA-         A           A+
  German                A+         -NA-         A
Mains (GroupName)
  Maths                 B            A          A
  Physics               A            A          -NA-
  Chemistry             A            B          -NA-
  Economics             -NA-        -NA-         A
  Commerce              -NA-        -NA-         A


No. of students is not fix
No. subjects is not fix
No. Groups is not fix

I need to bind List<students> to DataGrid/ListView

What I have tried:

I tried ListView with CollectionViewSource and GroupStyle but i am able to display only one student record.
Posted
Updated 11-Mar-20 22:55pm
v4

1 solution

 
Share this answer
 
Comments
Maciej Los 12-Mar-20 4:57am    
MSDN documentation is always good for start.
chimmansrikanth 12-Mar-20 5:09am    
Yes, but I could not relate anything related to my problem. Thank you
Maciej Los 12-Mar-20 5:15am    
WPF is using MVVM pattern. So, you have to create model, view and viewmodel which corresponds to your design.
Richard MacCutchan 12-Mar-20 5:19am    
What problem? You have not given us any information.
chimmansrikanth 12-Mar-20 5:26am    
I want to show the List<student> in DataGrid or ListView as specified in the question, which I am not able to do. I tried ListView with CollectionViewSource and GroupStyle but i am able to display only one student record.

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