0

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>

代码隐藏

protected void Page_Load(object sender, EventArgs e)
{
    SqlDataSourceUserMetersTree.SelectCommand = "SELECT * FROM Tree";
    ASPxTreeListLocations.DataBind();
}

问题:

代码运行良好。我想递归选择,但这个属性不起作用。如果我在 aspx 端定义 SqlDataSource selectCommand,它就可以工作。我找不到任何解决方案。没有错误信息。有什么建议吗?

谢谢...

4

1 回答 1

0

尝试将选项添加recursive = "true"到您的树设置中,NP

于 2019-06-25T13:03:30.670 回答