2

我需要从 Telerik radDropDownTree 获取所有选定的项目并在 c# 中创建 xml 文档

<telerik:RadDropDownTree ID="rddt" runat="server" CheckBoxes="TriState" DefaultMessage="Select documents" DataFieldID="ID" DataFieldParentID="parentID" DataTextField="name" DataValueField="ID" DataSourceID="ds2">
<ButtonSettings ShowCheckAll="true" ShowClear="true" />
<Localization CheckAll="Select All Resources" />                  
</telerik:RadDropDownTree>

如何从选定的项目中获取 ID 和 ParentID?

var xdoc = new XDocument(
                           new XElement("Root",
                                  new XElement("Resource",
                                          rddt.SelectedValue.Select(x => new XElement("ID", x)),
                                          rddt.SelectedValue.Select(x=>new XElement("ParentID",x)))));

非常感谢

4

0 回答 0