A Solution for Binding Silverlight DataGrid Columns to 2nd Level Collection - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Tuesday, June 14, 2011

A Solution for Binding Silverlight DataGrid Columns to 2nd Level Collection

Supreet Tare posted a thread on MSDN Forum to help him binding a 2nd Level Collection in Silverlight DataGrid control. As he didn't find any good solution there, he asked me on Twitter to give a solution to him for the same. I did a small investigation and came up with a solution for him.   In this post, I am going to describe the problem, as well as solution to this. Hope this solution will be helpful to you too and hence sharing in my blog. Read more to find out the solution.   Problem Statement Suppose we have a collection of Students which includes a string property called "Firstname" and another property called "Marks" of type Collection. Each Mark consists of Subject and Subject Mark for example. See the collection structure as shown below:       Now, if we assign the Student collection to a DataGrid directly, it shows the data as below:     So, we need a solution that will show each of the...

No comments:

Post a Comment