【问题标题】:how to add Data to datagrid inside datagrid on button click from two different table如何从两个不同的表单击按钮时将数据添加到数据网格内的数据网格
【发布时间】:2011-03-17 12:38:38
【问题描述】:

我有一个显示员工信息的数据网格。在选择此网格的行时,我想将其扩展到另一个网格,显示该员工的部门信息。

我在外部数据网格的 rowdetailstemplate 中添加了一个数据网格。并希望在选择外行时将数据绑定到它。 谁能告诉我该怎么做,因为我是silverlight的新手,没有找到任何解决方案。

【问题讨论】:

    标签: silverlight-4.0 datagrid


    【解决方案1】:

    您可以从外部网格将内部网格绑定到 DataItem 上的属性:

    <asp:DataGrid id="innerGrid" runat="server" DataSource="<%# ((OuterObject)Container.DataItem).DataSourceForInnerGrid %>">...</asp:DataGrid>
    

    【讨论】:

    • 你好,乔希,谢谢你的回复,但我只想要 Silverlight 中的解决方案。抱歉添加了不正确的信息
    • 我明白了。我相信其他人可以提供更好的帮助!
    猜你喜欢
    • 1970-01-01
    • 2010-12-15
    • 1970-01-01
    • 2011-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多