简体   繁体   English

Silverlight dataGrid 与 ria 服务的绑定不起作用

[英]Silverlight dataGrid binding with ria Service doesn' work

i'm new to Silverlight and it's totally driving me crazy!我是 Silverlight 的新手,这让我快疯了!

i'm using SL4 and trying to bind datagrid with a Domain Service Query:我正在使用 SL4 并尝试将数据网格与域服务查询绑定:

what i did exactly is i generate an ado.net entity model from my database, then create a domain Service class from this model.我所做的是从我的数据库生成一个 ado.net 实体模型,然后从这个模型创建一个域服务类。

then in my page i put Datagrid & button.然后在我的页面中,我放了 Datagrid & 按钮。

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 ?谁能帮我这个 ?

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. Silverlight 仅是异步的,因此如果查询很大,它可能需要很长时间才能返回,或者如果它是一个超过 64k 限制的大型查询,它可能会失败并且您不知道它。

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.作为一个想法,如果您使用 RIA 服务绑定到相当简单的东西,请使用实体的“数据源”,它不太可能出现问题。

Link 关联

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM