Get/Load XML Orientation Problems

6 posts, 1 answers
  1. cdikmen
    cdikmen avatar
    25 posts
    Member since:
    Aug 2006

    Posted 04 May 2009 Link to this post

    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!
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 May 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. cdikmen
    cdikmen avatar
    25 posts
    Member since:
    Aug 2006

    Posted 04 May 2009 Link to this post

    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
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 May 2009 Link to this post

    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.
  6. cdikmen
    cdikmen avatar
    25 posts
    Member since:
    Aug 2006

    Posted 04 May 2009 Link to this post

    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:

  7. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 04 May 2009 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017