Hello,
I'm new to Telerik world and creating a RadMenu like this:
which is working fine.
Now, trying to do the same dynamically in the code-behind, it doesn't work. Here is my code:
"myLabel" is a label on my test page.
I suppose the problem is with the levelSettings, but I don't see where is the error. Could anyone help, please ?
I'm new to Telerik world and creating a RadMenu like this:
| <telerik:RadSiteMap runat="server" |
| ID="RadSiteMapPublications" DataSourceID="RadSiteMapDataPublications" Width="640px"> |
| <LevelSettings> |
| <telerik:SiteMapLevelSetting Level="0" ListLayout-RepeatColumns="4" ListLayout-RepeatDirection="Horizontal"></telerik:SiteMapLevelSetting> |
| </LevelSettings> |
| </telerik:RadSiteMap> |
| <telerik:RadSiteMapDataSource ID="RadSiteMapDataPublications" SiteMapFile="~/web.sitemap" ShowStartingNode="false" StartingNodeUrl="http://saratoga/lr/pages/default.aspx?id=2036" runat="server" /> |
which is working fine.
Now, trying to do the same dynamically in the code-behind, it doesn't work. Here is my code:
| Dim myDataSource As New RadSiteMapDataSource |
| myDataSource.SiteMapFile = "~/web.sitemap" |
| myDataSource.ShowStartingNode = False |
| myDataSource.StartingNodeUrl = "http://saratoga/lr/pages/default.aspx?id=2017" |
| Dim mySiteMap As New RadSiteMap |
| mySiteMap.Width = 640 |
| mySiteMap.Height = 200 |
| mySiteMap.DataSource = myDataSource |
| Dim mySetting As New SiteMapLevelSetting |
| mySetting.Level = 0 |
| mySetting.ListLayout.RepeatColumns = 4 |
| mySetting.ListLayout.RepeatDirection = SiteMapRepeatDirection.Horizontal |
| mySiteMap.LevelSettings.Add(mySetting) |
| myLabel.Controls.Add(mySiteMap) |
"myLabel" is a label on my test page.
I suppose the problem is with the levelSettings, but I don't see where is the error. Could anyone help, please ?