Silverlight-在数据网格内绑定列表框 [英] Silverlight - Bind Listboxes inside the datagrid

查看:106
本文介绍了Silverlight-在数据网格内绑定列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datagrid,在datagrid中,我必须根据特定记录的ID绑定一些列表框.

例如.

I have a datagrid , inside datagrid I have to bind some listbox (es) based on ID of the particular record.

For eg.

TextColumn 	TextColumn  TextColumn 	 TemplateColumn 
ID 	           NAME 	      CLASS       SUBJECT
1	           XXX	         A         JAVA
 	 	 	                   .NET
2	           YYY	         B	 .NET
 	 	 	                    C++
3	           ZZZ	         C	 JAVA
 	 	 	                    C++


SUBJECT列应加载到datagrid内的列表框中.我已经成功加载了DataGridTextColumn的(ID,NAME,CLASS)
但是我无法加载主题.

注意:我已经通过从WCF服务返回列表来绑定DataGrid中的DataGridTextColumn.

请执行需要的操作.


SUBJECT column should be loaded in a Listbox inside the datagrid. I have successfully loaded DataGridTextColumn‘s (ID,NAME ,CLASS)
But I couldnt able to load the SUBJECT.

NOTE : I have binded the DataGridTextColumn’s in the datagrid by returning a list from WCF service.

Please do the needful.

推荐答案

您好

请尝试此操作,可能对您有帮助

http://stackoverflow.com/Questions/7030353/silverlight-datagrid-inside-listbox-binding-on-datagrid-column-to-a-parent-lis [ http://forums.silverlight.net/t/121753.aspx/1 [ ^ ]

谢谢
Shiju
Hi

Please try this,may be helpful for you

http://stackoverflow.com/questions/7030353/silverlight-datagrid-inside-listbox-binding-on-datagrid-column-to-a-parent-lis[^]

http://forums.silverlight.net/t/121753.aspx/1[^]

Thanks
Shiju


好吧,您需要填充DataGridTemplateColumn中的列表框.在列表框的itemsource中,您可以添加以下内容:
Well, you need to fill the Listbox inside DataGridTemplateColumn. In the itemsource of your Listbox you can add something like this:
Itemsource={Binding {StaticSource domainservice}, Path=Data}


现在,在您的DataGridTemplateColumn中可以找到一个DataBinding属性(我只是不记得真实属性):


Now, in your DataGridTemplateColumn you can find a DataBinding property (I just cannot remember the real property):

DataBinding={Binding SUBJECT, Mode=TwoWay}



希望对您有所帮助.



Hope it helps.


这篇关于Silverlight-在数据网格内绑定列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆