绑定 silverlight 数据表单
大家好,我在 silverlight 4 项目项源中的数据表是:
ItemsSource="{Binding Data, ElementName=domainDataSource1, Mode=TwoWay}"
域数据源是:
<riaControls:DomainDataSource Name="domainDataSource1" QueryName="GetCarsQuery" AutoLoad="True">
<riaControls:DomainDataSource.DomainContext>
<domain:DataDomainContext/>
</riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>
我的汽车表与拖车表有关系。我的数据表单上有组合框,我想在其中显示所有预告片标记,如何将组合框绑定到另一个查询? 当用户保存数据时,我如何获取带标记的预告片 ID?
谢谢
Hello guys i have dataform in silverlight 4 project item source is:
ItemsSource="{Binding Data, ElementName=domainDataSource1, Mode=TwoWay}"
and domain data source is :
<riaControls:DomainDataSource Name="domainDataSource1" QueryName="GetCarsQuery" AutoLoad="True">
<riaControls:DomainDataSource.DomainContext>
<domain:DataDomainContext/>
</riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>
My cars table have relationship with trailers table. I have combobox on my data form where i want to show all trailers marks how i can bind combobox another query?
And when user will save data how i can get trailers id with mark?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,我先说一下,从 SL5 开始,嵌套在 DataForm 中的 ComboBox 目前存在很多错误。但是在这里,这是使用实体框架:
关联的类:
在您的 XAML 中:
最后在您的组合框(或带有 ItemsSource 的任何控件)中:
First let me preface this by saying ComboBoxes nested in DataForms are currently VERY buggy as of SL5. But here you go, this is using Entity Framework:
The associated class:
In your XAML:
And finally in your combobox (or whatever control with ItemsSource):