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

I've a very unusual behaviour!

3 Answers 45 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
hamidx5
Top achievements
Rank 1
hamidx5 asked on 19 Sep 2010, 12:45 PM
Recently I nested a RadMenu with RadTreeView.When I run my app into an IE6 I have no problem but a big and bad thing happen when I run it in IE7 or firefox.
You can see what I am talking about in my attached file.
Thanks you in advance.

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 21 Sep 2010, 08:27 AM
Hi hamidx5,

Could you, please post a page reproducing this behavior (markup and code-behind)?
Once we get the code, we'll do our best to provide you with solution.

Hope that soon, we will resolve this!


Regards,
Nikolay Tsenkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
hamidx5
Top achievements
Rank 1
answered on 26 Sep 2010, 09:53 AM
Here is my Menu nested by TreeView in my MasterPage:
<telerik:RadMenu ID="mainMenu" runat="server" dir="rtl" Visible="false" BorderStyle="None"
      BorderColor="Transparent" BackColor="Transparent">
      <Items>
          <telerik:RadMenuItem runat="server" Text="اطلاعات موجودیت ها" Font-Name="Tahoma"
              ForeColor="White" BorderStyle="None" BorderColor="Transparent" BackColor="Transparent"
              CssClass="rmRootGroup" Font-Bold="true">
              <Items>
                  <telerik:RadMenuItem runat="server" Text="اشخاص" Font-Name="Tahoma">
                      <Items>
                          <telerik:RadMenuItem runat="server" Text="شاغل دائم" Font-Name="Tahoma">
                              <Items>
                                  <telerik:RadMenuItem>
                                      <ItemTemplate>
                                          <telerik:RadTreeView ID="trvContractorPosition" runat="server" dir="rtl" DataFieldID="Id"
                                              DataFieldParentID="ParentId" DataSourceID="odsAreaCP" DataTextField="Name" DataValueField="Id"
                                              MaxDataBindDepth="4" OnDataBound="trvContractorPosition_DataBound" Font-Names="Tahoma">
                                          </telerik:RadTreeView>
                                          <core:areadatasource id="odsAreaCP" runat="server">  
                                          </core:areadatasource>
                                      </ItemTemplate>
                                  </telerik:RadMenuItem>
                              </Items>
                          </telerik:RadMenuItem>
                          <telerik:RadMenuItem runat="server" Text="نیروی کار موقت" Font-Name="Tahoma">
                              <Items>
                                  <telerik:RadMenuItem>
                                      <ItemTemplate>
                                          <telerik:RadTreeView ID="trvTempContractorPosition" runat="server" dir="rtl" DataFieldID="Id"
                                              DataFieldParentID="ParentId" DataSourceID="odsAreaTCP" DataTextField="Name" DataValueField="Id"
                                              MaxDataBindDepth="4" OnDataBound="trvTempContractorPosition_DataBound" Font-Names="Tahoma">
                                          </telerik:RadTreeView>
                                          <core:areadatasource id="odsAreaTCP" runat="server">  
                                          </core:areadatasource>
                                      </ItemTemplate>
                                  </telerik:RadMenuItem>
                              </Items>
                          </telerik:RadMenuItem>
                      </Items>
                  </telerik:RadMenuItem>
              </Items>
          </telerik:RadMenuItem>
      </Items>
  </telerik:RadMenu>
I uses following code to generate my treeview nodes runtime and dynamically:
private void MakeChildNodes(RadTreeNode relatedContractorPosition, EntityCollection<ContractorPositionTEntity> relatedContractorPositionByParentNode)
{
    foreach (ContractorPositionTEntity contractorPositionTEntity in relatedContractorPositionByParentNode)
    {
 
        var childNodes = CoreFacadeFactory.Instance.GetContractorPositionFacade().Read(
                   en => en.ContractorPositionParentId == contractorPositionTEntity.Id);
 
        var relatedContractor =
              CoreFacadeFactory.Instance.GetContractorFacade().Read(
                  en => en.Id == contractorPositionTEntity.ContractorId)[0];
        var radTreeNode = new RadTreeNode
        {
            ForeColor = Color.Green,
            Value = contractorPositionTEntity.Id.ToString(),
            Text = relatedContractor.Name,
            NavigateUrl = "../SubSystems/BeforeFinal/PractitionerBeforeFinal.aspx?ContractorId=" + contractorPositionTEntity.Id.ToString()
        };
        relatedContractorPosition.Nodes.Add(radTreeNode);
 
        if (childNodes.Count > 0)
        {
            //Call iteself
            MakeChildNodes(radTreeNode, childNodes);
        }
        else
        {
            return;
            //Add this node
        }
    }
 
}
 
 
protected void trvContractorPosition_DataBound(object sender, EventArgs e)
{
    var allAreaNodes = ((RadTreeView)sender).GetAllNodes();
 
    foreach (RadTreeNode areaNode in allAreaNodes)
    {
        areaNode.ImageUrl = "/SubSystems/CommonEditPage/PictureView.aspx?type=Contractor&AreaId=" + areaNode.Value;
 
        var relatedContractorPositions =
            CoreFacadeFactory.Instance.GetContractorPositionFacade().Read(
                en => en.AreaId == new Guid(areaNode.Value));
 
        relatedContractorPositions.Sort("ContractorPositionParentId", ListSortDirection.Ascending, null);
 
        foreach (ContractorPositionTEntity relatedContractorPosition in relatedContractorPositions)
        {
            if (relatedContractorPosition.ContractorPositionParentId == null)
            {
                var relatedContractor =
               CoreFacadeFactory.Instance.GetContractorFacade().Read(
                   en => en.Id == relatedContractorPosition.ContractorId)[0];
                var radTreeNode = new RadTreeNode
                {
                    // ImageUrl = "/SubSystems/CommonEditPage/PictureView.aspx?type=Contractor&Id=" + relatedContractor.Id,
                    ForeColor = Color.Green,
                    Value = relatedContractorPosition.Id.ToString(),
                    Text = relatedContractor.Name,
                    NavigateUrl = "../SubSystems/BeforeFinal/PractitionerBeforeFinal.aspx?ContractorId=" + relatedContractorPosition.Id.ToString()
                };
                areaNode.Nodes.Add(radTreeNode);
 
                //Call recursive method
                var relatedContractorPositionByParentNode = CoreFacadeFactory.Instance.GetContractorPositionFacade().Read(
                    en => en.ContractorPositionParentId == new Guid(radTreeNode.Value));
 
                MakeChildNodesAutomotive(radTreeNode, relatedContractorPositionByParentNode);
            }
 
        }
    }
 
 
 
 
}
 
#region TempWorker
private void TempMakeChildNodes(RadTreeNode relatedContractorPosition, EntityCollection<ContractorPositionTEntity> relatedContractorPositionByParentNode)
{
    foreach (ContractorPositionTEntity contractorPositionTEntity in relatedContractorPositionByParentNode)
    {
 
        var childNodes = CoreFacadeFactory.Instance.GetContractorPositionFacade().Read(
                   en => en.ContractorPositionParentId == contractorPositionTEntity.Id);
 
        var relatedContractor =
              CoreFacadeFactory.Instance.GetContractorFacade().Read(
                  en => en.Id == contractorPositionTEntity.ContractorId)[0];
        var radTreeNode = new RadTreeNode
        {
            ForeColor = Color.Green,
            Value = contractorPositionTEntity.Id.ToString(),
            Text = relatedContractor.Name,
            NavigateUrl = "../SubSystems/BeforeFinal/TempWorkerBeforeFinal.aspx?ContractorId=" + contractorPositionTEntity.Id.ToString()
        };
        relatedContractorPosition.Nodes.Add(radTreeNode);
 
        if (childNodes.Count > 0)
        {
            //Call iteself
            TempMakeChildNodes(radTreeNode, childNodes);
        }
        else
        {
            return;
            //Add this node
        }
    }
 
}
 
 
protected void trvTempContractorPosition_DataBound(object sender, EventArgs e)
{
    var allAreaNodes = ((RadTreeView)sender).GetAllNodes();
 
    foreach (RadTreeNode areaNode in allAreaNodes)
    {
        areaNode.ImageUrl = "/SubSystems/CommonEditPage/PictureView.aspx?type=Contractor&AreaId=" + areaNode.Value;
 
        var relatedContractorPositions =
            CoreFacadeFactory.Instance.GetContractorPositionFacade().Read(
                en => en.AreaId == new Guid(areaNode.Value));
 
        relatedContractorPositions.Sort("ContractorPositionParentId", ListSortDirection.Ascending, null);
 
        foreach (ContractorPositionTEntity relatedContractorPosition in relatedContractorPositions)
        {
            if (relatedContractorPosition.ContractorPositionParentId == null)
            {
                var relatedContractor =
               CoreFacadeFactory.Instance.GetContractorFacade().Read(
                   en => en.Id == relatedContractorPosition.ContractorId)[0];
                var radTreeNode = new RadTreeNode
                {
                    // ImageUrl = "/SubSystems/CommonEditPage/PictureView.aspx?type=Contractor&Id=" + relatedContractor.Id,
                    ForeColor = Color.Green,
                    Value = relatedContractorPosition.Id.ToString(),
                    Text = relatedContractor.Name,
                    NavigateUrl = "../SubSystems/BeforeFinal/TempWorkerBeforeFinal.aspx?ContractorId=" + relatedContractorPosition.Id.ToString()
                };
                areaNode.Nodes.Add(radTreeNode);
 
                //Call recursive method
                var relatedContractorPositionByParentNode = CoreFacadeFactory.Instance.GetContractorPositionFacade().Read(
                    en => en.ContractorPositionParentId == new Guid(radTreeNode.Value));
 
                TempMakeChildNodes(radTreeNode, relatedContractorPositionByParentNode);
            }
 
        }
    }
 
 
 
 
 
 
}

Thanks in advance
0
Nikolay Tsenkov
Telerik team
answered on 30 Sep 2010, 11:19 AM
Hello hamidx5,

Thank you for providing source-code for my investigation.
Although I couldn't reproduce the problem on mi side. Everything was shown smoothly with no breaking out TreeViews.

Could you please provide me with something runnable, that reproduces the behavior. This way we will minimize the correspondence regarding the problems reproduction and will resolve the problem faster!

Hope that soon we will resolve this problem!


Regards,
Nikolay Tsenkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
hamidx5
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
hamidx5
Top achievements
Rank 1
Share this question
or