Skip to main content

Microsoft Silverlight

Answered Question how to bind DataTable to silverlight DataGrid?RSS Feed

(0)

avtar
avtar

Member

Member

63 points

69 Posts

how to bind DataTable to silverlight DataGrid?

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.

Please click on "Mark As Answer", if this answered your query partially or fully.

bryant
bryant

Star

Star

9927 points

1,629 Posts

Silverlight MVP
Answered Question

Re: how to bind DataTable to silverlight DataGrid?

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.

-- bryant

Blog | Twitter
_________________
Dont forget to click "Mark as Answer" on the post that helped you.

avtar
avtar

Member

Member

63 points

69 Posts

Answered Question

Re: how to bind DataTable to silverlight DataGrid?

 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.

Avtar.

Please click on "Mark As Answer", if this answered your query partially or fully.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities