Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1620
Levels[0]: UltraWebTree to WebDataTree:
posted

I am converting Infragistics 2010 v2 CLR3.5 to Infragistics 2014 v2 using 4.5 CLR using Visual Studio 2013 Professional Update 4. I am getting following error while building the project. Please reply immediately..........Try to give solution of below code of using alternative of Levels instead of changing whole functionality. Let me know the alternative of using "Levels" in the existing code plzzzz.

Below error is there while trying to load to get MenuList where "UltraWebTree" being used previously. Now I am upgrading to "WebDataTree" to get functionality, due to which in WebDataTree1 - related to Levels the error is coming:

Error 324 'Infragistics.Web.UI.NavigationControls.WebDataTree' does not contain a definition for 'Levels' and no extension method 'Levels' accepting a first argument of type 'Infragistics.Web.UI.NavigationControls.WebDataTree' could be found (are you missing a using directive or an assembly reference?)

Code is given below:

menuDS.Tables.Add(mnu3Table);
               menuDS.Tables.Add(mnu2Table);
               menuDS.Tables.Add(mnu1Table);
               UltraWebTree1.Levels[0].ColumnName = "Menu2_Nm";
               //WebDataTree1.Nodes[0].Levels[0].ColumnName = "Menu2_Nm"; see this it is not taking Levels of above line, here i need alternative as I can't change code
               
               WebDataTree1.Levels[0].LevelKeyField = "Menu2_ItemID";
               if (menuDS.Tables["Menu3"].Rows.Count > 0)
               {
                   menuDS.Relations.Add("MenuLevel1",
                       menuDS.Tables["Menu2"].Columns["Menu2_ID"],
                       menuDS.Tables["Menu3"].Columns["Menu3_parentID"]);
 
                   WebDataTree1.Levels[0].RelationName = "MenuLevel1"; //here also same error coming
                   WebDataTree1.Levels[1].ColumnName = "Menu3_Nm"; //here also same error coming
                   WebDataTree1.Levels[1].LevelKeyField = "Menu3_ItemID"; //here also same error coming
               }
 
               if (menuDS.Tables["Menu4"].Rows.Count > 0)
               {
                   menuDS.Relations.Add("MenuLevel2",
                       menuDS.Tables["Menu3"].Columns["Menu3_ID"],
                       menuDS.Tables["Menu4"].Columns["Menu4_parentID"]);
                   WebDataTree1.Levels[1].RelationName = "MenuLevel2";
                   WebDataTree1.Levels[2].ColumnName = "Menu4_Nm";
                   WebDataTree1.Levels[2].LevelKeyField = "Menu4_ItemID";
               }
 
               WebDataTree1.DataSource = menuDS;
               WebDataTree1.DataMember = "Menu2";
               WebDataTree1.DataBind();
           }
       }

Parents Reply Children
  • 2671
    Offline posted in reply to Jack

    Hello,


    As explained above and in linked post, the equivalent of Levels is the DataBindings collection and each binding is equivalent to each level definition.

    Levels Property: Returns a reference to a Levels collection that represents each particular hierarchical level of the tree. This is the DataBindings collection in the new control.


    Please refer again to the code above:

    - Each level is a DataTreeNodeBinding: This class controls the databinding process of populating the properties of each bound node to the data fields in the datasource.

    DataTreeNodeBinding binding = new DataTreeNodeBinding();

    - These are added to the DataBindings collection not Levels:

    this.WebDataTree2.DataBindings.Add(binding);

     

    Note that the WebDataTree will perform auto mapping of bindings to provided data so properties of the bindings must be accurate. Also notice that the bindings have a KeyField which is the LevelKeyField:

    binding.KeyField = "Menu3_ItemID";

     

    Please examine the sample code above as I tried to replicate your initial code (including DataTables, relations and column names) and without further information I cannot reproduce any error you might be seeing.

    If this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

     

    Please let me know if I can provide any further assistance.

     

    Regards,

    Damyan Petev

    Associate Software Developer

    Infragistics, Inc.