This is a migrated thread and some comments may be shown as answers.

Get/Load XML Orientation Problems

5 Answers 89 Views
Menu
This is a migrated thread and some comments may be shown as answers.
cdikmen
Top achievements
Rank 1
cdikmen asked on 04 May 2009, 12:44 PM
Per the suggestions from Albert in Tech Support, I am trying to cache the XML from my menu using GetXml, which seems to work perfectly. However, when I use .LoadXml, the menu takes on a Vertical orientation down the left side of the page as opposed to Horizontal across the top of the page.

Here is the XML file:

<?xmlversion="1.0" encoding="utf-16" ?>
- <Menu style="top:0px; left: 0px">
- <Group Flow="Horizontal"OffsetX="10" OffsetY="10" Width="150px"Height="400px">
  <Item Text="Home"NavigateUrl="~/default.aspx" />
- <Item Text="MenuOne" NavigateUrl="~/PageOne.aspx">
- <Group>
  <Item Text="Item One" NavigateUrl="~/Page.aspx?cl=855" />
  <Item Text="Item Two"NavigateUrl="~/Page.aspx?cl=1015" />
  <Item Text="Item Three"NavigateUrl="~/Page.aspx?cl=985" />
  <Item Text="Item Four"NavigateUrl="~/Page.aspx?cl=508" />
 </Group>
  </Item>
  <Item Text="Information"NavigateUrl="~/Info.aspx" />
  <Item Text="Community"NavigateUrl="http://www.forums.org" Target="_new" />
  <Item Text="Request a Quote"NavigateUrl="~/Quote.aspx" />
  </Group>
  </Menu>

I have tried changing the GroupFlow from "Vertical" to "Horizontal" and neither one works. And, when I set the Flow properties of the menu, it does not get written out to the XML file.

I tried using RadMenu.Flow="Horizontal" after the LoadXml method, but it still displays vertically. Any ideas?

Thanks!

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 May 2009, 01:08 PM
Hello cdikmen,

The menu looks vertical because of the Width setting - the menu is too short and it wraps. Could you please let us know what is the initial structure of the menu (prior to calling GetXml)? There may be a problem with serializing the menu in your particular setup.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
cdikmen
Top achievements
Rank 1
answered on 04 May 2009, 01:30 PM
Here is the code that establishes the Menu:

<telerik:RadMenu ID="RMMaster" Runat="server" Flow="Horizontal" style="top: 0px; left: 0px"
        <DefaultGroupSettings OffsetX="10" OffsetY="10" /> 
<DefaultGroupSettings OffsetX="10" OffsetY="10"></DefaultGroupSettings> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                                <Items> 
                                    <telerik:RadMenuItem runat="server" NavigateUrl="~/Home.aspx" Text="Home"
                                    </telerik:RadMenuItem> 
                                    <telerik:RadMenuItem runat="server" NavigateUrl="~/LineList.aspx"  
                                        Text="Lines"
                                    </telerik:RadMenuItem> 
                                    <telerik:RadMenuItem runat="server" NavigateUrl="~/ReviewList.aspx"  
                                        Text="Cruise Reviews"
                                    </telerik:RadMenuItem> 
                                    <telerik:RadMenuItem runat="server" Text="Community" NavigateUrl="http://www.frumt.org" Target="_new"
                                    </telerik:RadMenuItem> 
                                    <telerik:RadMenuItem runat="server" NavigateUrl="~/Request.aspx"  
                                        Text="Request a Quote"
                                    </telerik:RadMenuItem> 
                                </Items> 
                            </telerik:RadMenu> 



I am populating the Menu Item 1 (Lines) with contents from a database then using GetXml to store the results in Cache. The first time I run the script (when the cache is empty), I build the menu 1 in a loop through data and everything displays perfectly.Here is my Code Behind:


        If Cache("RMMasterXml"Is Nothing Then 
            'Get a datatable for menu items 
            Dim DT As DataTable = CacheObj.CruiseLines 
            'Create a RadMenuItem to populate with data 
            Dim RM1 As RadMenuItem = RMMaster.Items(1) 
 
            'Loop through each row and add an item to the Menu 
            For Each row As DataRow In DT.Rows 
 
                Dim RMCruiseItem As New Telerik.Web.UI.RadMenuItem 
                RMCruiseItem.Text = row("comp_name").ToString 
                RMCruiseItem.NavigateUrl = "~/CruiseLine.aspx?cl=" + row("comp_id").ToString 
 
                RM1.Items.Add(RMCruiseItem) 
 
            Next 
 
            'Put the XML into a string then write to cache 
            Dim RMMasterXml As String = RMMaster.GetXml() 
 
            Cache.Insert("RMMasterXml", RMMasterXml.ToString, Nothing, Now.AddHours(4), TimeSpan.Zero) 
 
        Else 
 
            'If the cache is NOT empty, then use the cached menu 
 
            Dim StrXml As String = CType(Cache("RMMasterXml"), String
             
            RMMaster.LoadXml(StrXml.ToString) 
 
 
        End If 




Thanks for your help
0
Atanas Korchev
Telerik team
answered on 04 May 2009, 01:47 PM
Hi cdikmen,

I tried your setup using the current official release but it behaved as expected. Which version are you using? I have tested with 2009.1.402 (as specified by this forum post). I have also attached my test page.

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
cdikmen
Top achievements
Rank 1
answered on 04 May 2009, 01:56 PM
I am using the Q1 2008 version of Rad for Ajax. Here is a page I created to show you the results I am getting:

0
Accepted
Atanas Korchev
Telerik team
answered on 04 May 2009, 02:25 PM
Hello cdikmen,

Unfortunately the version which you are using has a bug with loading and saving XML. I strongly recommend upgrading. This issue should have been resolved in Q2 2008 SP1.

Sincerely yours,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Menu
Asked by
cdikmen
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
cdikmen
Top achievements
Rank 1
Share this question
or