Skip to main content
Home Forums Silverlight Programming Programming with .NET - General how to bind DataTable to silverlight DataGrid?
2 replies. Latest Post by avtar on January 7, 2009.
(0)
avtar
Member
63 points
69 Posts
01-06-2009 8:34 AM |
Hi,
after strugling 2 days, still I am not able to bind my DataTable to silervlight DataGrid.
i am using WCF with silverlight client.
structure of my DataTable is Dynamic......
whenever i page get load, a request to WCF method take place, which in turn call my DAL method and get DataTable, i want to show the data of my DataTable into DataGrid of my silverlight client.
I know that System.Data isn't available in silverlight client,
What whould be the best way to acomplished this???
Thanks.
Avtar.
bryant
Star
9927 points
1,629 Posts
01-06-2009 11:17 AM |
You will need to create some business objects to represent your data and return a list of those objects.
Another method if your data is more dynamic is to just return XML (or JSON) and parse it on the client side. However, you're probably better off typing your data.
01-07-2009 12:31 AM |
Hi Bryant,
I understand your point that we need a business object but its not easy to create run time class with the same structure of DataTable, however i found this thread that is realy helpful and able to bind my Datatable to silverlight DataGrid
http://silverlight.net/forums/t/16733.aspx
Thanks lot.