When i check the list in debug, it is filled correctly and then it is
Here is the code:
aspx:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<div>
<telerik:RadMenu runat="server" ID="CategoriesMenu" Skin="Black"
DataTextField="Title" DataFieldID="Id"
DataSourceID="objectDS" DataFieldParentID="ParentId"
DataNavigateUrlField="Id" DataValueField="Id" AppendDataBoundItems="True">
</telerik:RadMenu>
<asp:GridView runat="server" ID="TestGrid"></asp:GridView>
</div>
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="IpitchitWebsiteModel.IpitchitWebsiteModelDataContext"
Select="new (Id, ParentID, Title)" TableName="Categories">
</asp:LinqDataSource>
<asp:ObjectDataSource runat="server" ID="objectDS" SelectMethod="GetTreeByParent"
TypeName="IpitchitWebsiteModel.DataRepository.CategoryRepositoy">
<SelectParameters>
<asp:Parameter Name="id" Type="Int32" DefaultValue="10" />
<asp:Parameter Name="visibility" Type="Int32" DefaultValue="0" />
<asp:Parameter Name="showRootCategory" Type="Boolean" DefaultValue="false" />
</SelectParameters>
</asp:ObjectDataSource>
cs:
[DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
public List<Categories_GetTreeByParentResult> GetTreeByParent(int? id, int visibility, bool showRootCategory)
{
return db.Categories_GetTreeByParent(id, visibility, showRootCategory).ToList();
}
from dbml:
So when i remove parentid parameter DataFieldParentID menu control will work. Otherwise not. This looks to me as bug.
Here is the code:
aspx:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<div>
<telerik:RadMenu runat="server" ID="CategoriesMenu" Skin="Black"
DataTextField="Title" DataFieldID="Id"
DataSourceID="objectDS" DataFieldParentID="ParentId"
DataNavigateUrlField="Id" DataValueField="Id" AppendDataBoundItems="True">
</telerik:RadMenu>
<asp:GridView runat="server" ID="TestGrid"></asp:GridView>
</div>
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="IpitchitWebsiteModel.IpitchitWebsiteModelDataContext"
Select="new (Id, ParentID, Title)" TableName="Categories">
</asp:LinqDataSource>
<asp:ObjectDataSource runat="server" ID="objectDS" SelectMethod="GetTreeByParent"
TypeName="IpitchitWebsiteModel.DataRepository.CategoryRepositoy">
<SelectParameters>
<asp:Parameter Name="id" Type="Int32" DefaultValue="10" />
<asp:Parameter Name="visibility" Type="Int32" DefaultValue="0" />
<asp:Parameter Name="showRootCategory" Type="Boolean" DefaultValue="false" />
</SelectParameters>
</asp:ObjectDataSource>
cs:
[DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
public List<Categories_GetTreeByParentResult> GetTreeByParent(int? id, int visibility, bool showRootCategory)
{
return db.Categories_GetTreeByParent(id, visibility, showRootCategory).ToList();
}
from dbml:
| public partial class Categories_GetTreeByParentResult |
| { |
| private System.Nullable<int> _Id; |
| private System.Nullable<int> _ParentId; |
| private string _Title; |
| private string _Description; |
| private System.Nullable<int> _Ordering; |
| private System.Nullable<System.DateTime> _CreatedDate; |
| private string _CreatedBy; |
| private System.Nullable<System.DateTime> _ModifiedDate; |
| private string _ModifiedBy; |
| private System.Nullable<bool> _IsSearchable; |
| private System.Nullable<byte> _VisiblityIndex; |
| private System.Nullable<int> _RecursionLevel; |
| private string _Path; |
| public Categories_GetTreeByParentResult() |
| { |
| } |
| [Column(Storage="_Id", DbType="Int")] |
| public System.Nullable<int> Id |
| { |
| get |
| { |
| return this._Id; |
| } |
| set |
| { |
| if ((this._Id != value)) |
| { |
| this._Id = value; |
| } |
| } |
| } |
| [Column(Storage="_ParentId", DbType="Int")] |
| public System.Nullable<int> ParentId |
| { |
| get |
| { |
| return this._ParentId; |
| } |
| set |
| { |
| if ((this._ParentId != value)) |
| { |
| this._ParentId = value; |
| } |
| } |
| } |
| [Column(Storage="_Title", DbType="NVarChar(250)")] |
| public string Title |
| { |
| get |
| { |
| return this._Title; |
| } |
| set |
| { |
| if ((this._Title != value)) |
| { |
| this._Title = value; |
| } |
| } |
| } |
| [Column(Storage="_Description", DbType="NVarChar(300)")] |
| public string Description |
| { |
| get |
| { |
| return this._Description; |
| } |
| set |
| { |
| if ((this._Description != value)) |
| { |
| this._Description = value; |
| } |
| } |
| } |
| [Column(Storage="_Ordering", DbType="Int")] |
| public System.Nullable<int> Ordering |
| { |
| get |
| { |
| return this._Ordering; |
| } |
| set |
| { |
| if ((this._Ordering != value)) |
| { |
| this._Ordering = value; |
| } |
| } |
| } |
| [Column(Storage="_CreatedDate", DbType="SmallDateTime")] |
| public System.Nullable<System.DateTime> CreatedDate |
| { |
| get |
| { |
| return this._CreatedDate; |
| } |
| set |
| { |
| if ((this._CreatedDate != value)) |
| { |
| this._CreatedDate = value; |
| } |
| } |
| } |
| [Column(Storage="_CreatedBy", DbType="NVarChar(50)")] |
| public string CreatedBy |
| { |
| get |
| { |
| return this._CreatedBy; |
| } |
| set |
| { |
| if ((this._CreatedBy != value)) |
| { |
| this._CreatedBy = value; |
| } |
| } |
| } |
| [Column(Storage="_ModifiedDate", DbType="SmallDateTime")] |
| public System.Nullable<System.DateTime> ModifiedDate |
| { |
| get |
| { |
| return this._ModifiedDate; |
| } |
| set |
| { |
| if ((this._ModifiedDate != value)) |
| { |
| this._ModifiedDate = value; |
| } |
| } |
| } |
| [Column(Storage="_ModifiedBy", DbType="NVarChar(50)")] |
| public string ModifiedBy |
| { |
| get |
| { |
| return this._ModifiedBy; |
| } |
| set |
| { |
| if ((this._ModifiedBy != value)) |
| { |
| this._ModifiedBy = value; |
| } |
| } |
| } |
| [Column(Storage="_IsSearchable", DbType="Bit")] |
| public System.Nullable<bool> IsSearchable |
| { |
| get |
| { |
| return this._IsSearchable; |
| } |
| set |
| { |
| if ((this._IsSearchable != value)) |
| { |
| this._IsSearchable = value; |
| } |
| } |
| } |
| [Column(Storage="_VisiblityIndex", DbType="TinyInt")] |
| public System.Nullable<byte> VisiblityIndex |
| { |
| get |
| { |
| return this._VisiblityIndex; |
| } |
| set |
| { |
| if ((this._VisiblityIndex != value)) |
| { |
| this._VisiblityIndex = value; |
| } |
| } |
| } |
| [Column(Storage="_RecursionLevel", DbType="Int")] |
| public System.Nullable<int> RecursionLevel |
| { |
| get |
| { |
| return this._RecursionLevel; |
| } |
| set |
| { |
| if ((this._RecursionLevel != value)) |
| { |
| this._RecursionLevel = value; |
| } |
| } |
| } |
| [Column(Storage="_Path", DbType="VarChar(2000)")] |
| public string Path |
| { |
| get |
| { |
| return this._Path; |
| } |
| set |
| { |
| if ((this._Path != value)) |
| { |
| this._Path = value; |
| } |
| } |
| } |
| } |
So when i remove parentid parameter DataFieldParentID menu control will work. Otherwise not. This looks to me as bug.