TreeList RadControl : No records to display
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开发者_如何学JAVA: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 :
- it works well so the problem doesn't come from here
- SousThemeID : Integer, SousThemLibelle : String, SousThemThemeID : integer
- 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.
Have a look at this sample on the telerik web site. It seems it's exactly what you're trying to do.
精彩评论