TreeList RadControl:没有可显示的记录

发布于 2024-11-10 12:37:48 字数 1591 浏览 5 评论 0原文

由于我必须为我的公司测试一些 RadControls 组件,因此我目前正在研究 TreeList 控件。即使我只尝试做基本的事情(用数据库查询填充控件)它也不起作用,我就是不明白为什么! 我之前的调查使我认为该问题与 DataKeyNames 和 ParentDataKeyNames 属性有关,但我不确定。 因此,我不会谈论我的工作,而是让您获取一个代码片段,以便您可以查看它:

<telerik:RadTreeList ID="RadTreeList1" runat="server"
        AllowMultiItemEdit="False" AllowPaging="True" Culture="(Default)"
        DataKeyNames="SousThemeID" ParentDataKeyNames="SousThemThemeID" AutoGenerateColumns="True" DataSourceID="SqlDataSource1" IsItemInserted="False">

<ValidationSettings CommandsToValidate="PerformInsert,Update"></ValidationSettings>
        <Columns>
            <telerik:TreeListBoundColumn UniqueName="column"></telerik:TreeListBoundColumn>
        </Columns>
<EditFormSettings EditFormType="AutoGenerated"></EditFormSettings>
</telerik:RadTreeList>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ContenuConnectionString %>"
        SelectCommand="SELECT [SousThemeID], [SousThemLibelle], [SousThemThemeID] FROM [SousTheme]">
    </asp:SqlDataSource>

这是关于我的查询的一些解释:

  1. 它运行良好,因此问题不是来自这里
  2. SousThemeID : Integer , SousThemLibelle :字符串, SousThemThemeID :整数
  3. SousTheme(表示主题下或下面的主题)与主题相关(Theme.ThemeID = SousTheme.SousThemThemeID)。

示例 :

[ 1 ] [ "测试" ] [ 1 ]

[ 2 ] [ "无论你想要什么" ] [ 1 ]

[ 3 ] [ "计算机" ] [ 1 ]

[ 4 ] [ "经济" ] [ 2 ]

[ 5 ] [ "Finance" ] [ 2 ]

如果您对我的代码出了什么问题有任何想法,请告诉我。 提前致谢。

亚历山大.

As I have to test some RadControls components for my company, I'm currently working on the TreeList control. Even if I only try to do basic stuff (populate the control with a database query) It doesn't work and I just can't figure out why !
My previous investigation lead me to think that issue is related to DataKeyNames and ParentDataKeyNames properties but I'm not sure.
So instead of talking about my work, I'll let you get an code snippet so as you can take a look at it :

<telerik:RadTreeList ID="RadTreeList1" runat="server"
        AllowMultiItemEdit="False" AllowPaging="True" Culture="(Default)"
        DataKeyNames="SousThemeID" ParentDataKeyNames="SousThemThemeID" AutoGenerateColumns="True" DataSourceID="SqlDataSource1" IsItemInserted="False">

<ValidationSettings CommandsToValidate="PerformInsert,Update"></ValidationSettings>
        <Columns>
            <telerik:TreeListBoundColumn UniqueName="column"></telerik:TreeListBoundColumn>
        </Columns>
<EditFormSettings EditFormType="AutoGenerated"></EditFormSettings>
</telerik:RadTreeList>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ContenuConnectionString %>"
        SelectCommand="SELECT [SousThemeID], [SousThemLibelle], [SousThemThemeID] FROM [SousTheme]">
    </asp:SqlDataSource>

Here's a little explanation concerning my query :

  1. it works well so the problem doesn't come from here
  2. SousThemeID : Integer, SousThemLibelle : String, SousThemThemeID : integer
  3. SousTheme (which means under-theme or theme below) is related to Theme (Theme.ThemeID = SousTheme.SousThemThemeID).

Example :

[ 1 ] [ "test" ] [ 1 ]

[ 2 ] [ "whatever you want" ] [ 1 ]

[ 3 ] [ "Computer" ] [ 1 ]

[ 4 ] [ "Economy" ] [ 2 ]

[ 5 ] [ "Finance" ] [ 2 ]

If you have any idea on what's going wrong in my code, please let me know.
Thanks in advance.

Alexandre.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

豆芽 2024-11-17 12:37:48

在 telerik 上查看此示例网站。看来这正是您想要做的。

Have a look at this sample on the telerik web site. It seems it's exactly what you're trying to do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文