views:

200

answers:

1

hi every one i'm new to Silverlight and it's totally driving me crazy !!

i'm using SL4 and trying to bind datagrid with a Domain Service Query:

what i did exactly is i generate an ado.net entity model from my database, then create a domain Service class from this model.

then in my page i put Datagrid & button.

in the click event for this button i write this code:

RRDomainContext rr = new RRDomainContext();

this.dataGrid1.ItemsSource = rr.Rooms;

this.rr.Load(this.rr.GetRoomsQuery());

when this method executed the nothing changed at the datagrid.

can anyone help me with this ?

A: 

Silverlight is async only, so if the query is a large one it can either take a long time to return, or if it's a large query that goes over the 64k limit it can fail and you don't know about it.

As a thought, if you're using RIA services to bind to something reasonably simple, use the "Data Source" for the entity, it's a lot less likely to give issues.

http://blogs.msdn.com/b/vsdata/archive/2009/12/01/the-data-source-window-support-in-wcf-ria-services.aspx

Doobi
the data is very small it's less than 5 recordsand i don't wanna to use data source thing because i wanna to deal with the object directly
Abdulrhman