overwritte datasource

2 posts, 0 answers
  1. Daniela
    Daniela avatar
    12 posts
    Member since:
    Aug 2010

    Posted 16 Sep 2011 Link to this post

    When using more than one RadSiteMap on the page the data source is overwritten.

      <telerik:RadSiteMap runat="server" ID="RadSiteMapCategoryPath" OnNodeDataBound="OnNodeDataBound_CategoryPath" MaxDataBindDepth="1">
        <telerik:SiteMapLevelSetting Level="0" Layout="Flow" SeparatorText="--">
          <ListLayout />
    <telerik:RadSiteMap runat="server" ID="RadSiteMapCategoryOwerview" OnNodeDataBound="OnNodeDataBound_CategoryOwerview" MaxDataBindDepth="1">
        <telerik:SiteMapLevelSetting Level="0">
          <ListLayout RepeatColumns="3" AlignRows="true" />

          var cats1 = new List<Categories>();
          this.ModifyWorkflowControlReadOnly(a =>
            cats1 = Categories.GetAll(a);
          RadSiteMapCategoryOwerview.DataTextField = "Name";
          RadSiteMapCategoryOwerview.DataValueField = "ID";
          RadSiteMapCategoryOwerview.DataFieldID = "ID";
          RadSiteMapCategoryOwerview.DataFieldParentID = "ID_Category_Parent";
          RadSiteMapCategoryOwerview.DataSource = cats1;
          var cats2 = new List<Categories>();
          this.ModifyWorkflowControlReadOnly(a =>
            cats2 = Categories.GetAll(a);
          // add start item
          Categories item = new Categories();
          item.Name = "Hautkategorien";
          RadSiteMapCategoryPath.DataTextField = "Name";
          RadSiteMapCategoryPath.DataValueField = "ID";
          RadSiteMapCategoryPath.DataFieldID = "ID";
          RadSiteMapCategoryPath.DataFieldParentID = "ID_Category_Parent";
          RadSiteMapCategoryPath.DataSource = cats2;

    The site map RadSiteMapCategoryPath and RadSiteMapCategoryOwerview show the same result.
    But the List cats1 and cats2 have different values.

    How can I solve this problem?

    Best regards
  2. Genady Sergeev
    Genady Sergeev avatar
    1600 posts

    Posted 20 Sep 2011 Link to this post

    Hello Daniela,

    As far as I can see both RadSiteMaps are bound against Categories.GetAllData(). How is that returning different values each time? I suggest that you double check that Categories.GetAllData is returning different lists, otherwise the SiteMaps would display the same by presumption.

    All the best,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top