ASPX
<dx:ASPxTreeList ID="ASPxTreeListLocations" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSourceUserMetersTree" KeyFieldName="sno" ParentFieldName="ParentId"
Width="300px" SettingsSelection-Recursive="true" Theme="Office2010Black">
<Columns>
<dx:TreeListTextColumn FieldName="Text" VisibleIndex="0" Caption="Lokasyon">
</dx:TreeListTextColumn>
</Columns>
<SettingsBehavior AutoExpandAllNodes="True" />
<SettingsSelection Enabled="True" />
</dx:ASPxTreeList>
<asp:SqlDataSource ID="SqlDataSourceUserMetersTree" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>">
</asp:SqlDataSource>
CODEBEHID
protected void Page_Load(object sender, EventArgs e)
{
SqlDataSourceUserMetersTree.SelectCommand = "SELECT * FROM Tree";
ASPxTreeListLocations.DataBind();
}
问题:
代码运作良好。我想递归选择,但这个属性不起作用。如果我在aspx端定义SqlDataSource selectCommand,它可以工作。我找不到任何解决方案。没有错误消息。有什么建议吗?
...谢谢
答案 0 :(得分:1)
答案 1 :(得分:0)
尝试将选项recursive = "true"
添加到树设置中,
NP