Problems with ExpandAllItems in OnApplyExpressions

8 posts, 0 answers
  1. Robin
    Robin avatar
    23 posts
    Member since:
    Oct 2011

    Posted 16 Aug 2012 Link to this post

    Just this week I upgraded to the most recent version of the telerik controls.
    On 1 of my pages I have a radtreelist and a radfilter. Part of the OnApplyExpressions method for the filter is to expand the tree. This was working just fine until I updated telerik (prior version was 2011.2.915.35).
    After upgrading the tree initially displays fine after a filter until I go to expand a child node at which point the tree removes all items except the parent node. If I comment out the ExpandAllItems() I can manually expand/collapse nodes w/o issue.

    What do I need to do to get it working again the way it was before?

    Thanks.
  2. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 21 Aug 2012 Link to this post

    Hi Robin,

    Can you share the code you used in the ApplyExpressions method and more specifically when you expand the treelist and filter it? I will modify the filtering demo of RadTreeList accordingly and see if I reproduce the issue.

    Greetings,
    Tsvetina
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Robin
    Robin avatar
    23 posts
    Member since:
    Oct 2011

    Posted 27 Aug 2012 Link to this post

    Sorry for not responding sooner, I was out of the office last week.
    I've included the code from the page in question. Method ApplyExpressions is where the issue is happening.

    Please let me know if you have any questions.

    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Text;
    using Acart.Targets;
    using Acart;
    using Acart.UserAdmin.Bo;
    using Acart.UserAdmin;
    using Acart.Targets.Bo;
    using Telerik.Web.UI;
     
    public partial class Admin_Portfolio_ManageTargets : BasePage
    {
        private TargetAdmin targetAdmin = new TargetAdmin();
        private UserManager userManager = new UserManager();
        private DataView targets = null;
        private System.Collections.Hashtable targetsContainer = null;
        public const string hidden_value_id = "hidden_value_id";
        public const string session_Target = "session_Target";
        public const string session_selected_nodes = "SESSION_SELECTED_NODES";
        public const string session_expand_nodes = "SESSION_EXPAND_NODES";
        public const string session_relative_nodes = "SESSION_RELATIVE_NODES";
        public const string session_error_message = "SESSION_ERROR_MESSAGE";
        public const string session_manage_Target_View = "SESSION_MANAGE_TARGET_VIEW";
        public const string session_manage_Target_Table = "SESSION_MANAGE_TARGET_TABLE";
        public const string session_manage_Target_FilterCondition = "SESSION_MANAGE_TARGET_FILTERCONDITION";
     
        private string strSelectedNodes = string.Empty;
        private string strExpandNodes = string.Empty;
        private string relativeNodeExpand = string.Empty;
        private User currentUser = null;
     
        /// <summary>
        /// verify if user logged in and approved
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void page_Init(object sender, EventArgs e)
        {
            {
                currentUser = (User)Session[GlobalConst.CURRENT_USER];
                Session[hidden_value_id] = null;
                Session[session_Target] = null;
            }
     
        }
     
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (!currentUser.IsPortfolioAdmin && !currentUser.IsSuperAdmin)
            {
                TreeView subMenu = (TreeView)this.Page.Master.FindControl("leftTree");
                subMenu.Visible = false;
                subMenu.Nodes[0].ChildNodes.Clear();
            }
        }
     
        /// <summary>
        /// get data for tree list control
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["currentUIPage"] = System.IO.Path.GetFileName(Request.Path);
     
            targets = (DataView)Session[session_manage_Target_View];
            if (IsCallback)
            {
                strSelectedNodes = (Session[session_selected_nodes]) != null ? (string)Session[session_selected_nodes] : "";
                strExpandNodes = (Session[session_expand_nodes]) != null ? (string)Session[session_expand_nodes] : "";
                relativeNodeExpand = (Session[session_relative_nodes]) != null ? (string)Session[session_relative_nodes] : "";
                string filterName = Session[session_manage_Target_FilterCondition] != null ? (string)Session[session_manage_Target_FilterCondition] : "";
                Session[session_selected_nodes] = null;
                Session[session_expand_nodes] = null;
                Session[session_error_message] = null;
            }
     
            if (Request.Form["__EVENTTARGET"] == "deleteOK")
            {
                DeleteSelected();
            }
            else
            {
                //if not super admin,do not show create portfolio button
                if (!currentUser.HasSystemFunc(Acart.UserAdmin.Bo.User.MANAGE_PORTFOLIOS))
                    btnCreateTarget.Visible = false;
     
                if (!IsPostBack)
                {
                    ViewState["ReloadPage"] = "FALSE";
                    string filterCondition = btnCreateTarget.Visible ? "parents" : string.Empty;
                    this.reloadPortfolio(false, filterCondition);
                }
     
                if (!IsPostBack)
                {
                    rtlPortfolios.DataSource = targets;
                    rtlPortfolios.DataBind();
                }
            }
        }
     
     
        /// <summary>
        /// make last 4 columns invisible on screen
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BindGridData(object sender, EventArgs e)
        {
            int colCount = this.rtlPortfolios.Columns.Count - 1;
            rtlPortfolios.Columns[colCount].Visible = false;
            rtlPortfolios.Columns[colCount - 1].Visible = false;
            rtlPortfolios.Columns[colCount - 2].Visible = false;
            rtlPortfolios.Columns[colCount - 3].Visible = false;
     
        }
     
        /// <summary>
        /// reload data into treelist control
        /// </summary>
        /// <param name="isFilter"></param>
        /// <param name="filterCondition"></param>
        public void reloadPortfolio(Boolean isFilter, String filterCondition)
        {
            Session[session_manage_Target_View] = null;
            DataTable tmpTable = null;
     
            if (currentUser.HasSystemFunc(Acart.UserAdmin.Bo.User.MANAGE_PORTFOLIOS))
            {
                if (string.IsNullOrEmpty(FilterExpression))
                    tmpTable = targetAdmin.getManagePortfolioData_TopLevel();
                else
                {
                    tmpTable = targetAdmin.getManagePortfolioData_FilteredData(FilterExpression);
                    tmpTable.DefaultView.RowFilter = " parentid is null ";
                }
            }
            else
            {
                tmpTable = userManager.GetAllTopLevelTargetsOfAdminRights(currentUser.UserName);
            }
            targets = new DataView(tmpTable);
            targets.Table.CaseSensitive = false;
     
            targetsContainer = targetAdmin.getTargetsContainer(tmpTable);
            Session[session_manage_Target_View] = targets;
            Session[session_manage_Target_Table] = tmpTable;
        }
     
        /// <summary>
        /// respond to node being dropped to a new location in treelist
        /// </summary>
        /// <param name="src"></param>
        /// <param name="dst"></param>
        public void OnNodeDrop(string src, string dst)
        {
            //update asertion_type table
            try
            {
                targetAdmin.moveTarget(src, dst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
     
        }
     
     
     
        protected void FilterData(object sender, EventArgs e)
        {
            LoopThruFilterControls(rfPortfolios.Controls);
            rfPortfolios.FireApplyCommand();
        }
     
     
        /// <summary>
        /// as each row is bound to data:
        /// 1) convert active_flag field to "Active" or "Inactive"
        /// 2) assign correct icon
        /// 3) generate URL for hyperlink to redirect to selected P/S/A
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BindRowData(object sender, Telerik.Web.UI.TreeListItemDataBoundEventArgs e)
        {
            TreeListItem gv = e.Item;
            if (gv.ItemType == TreeListItemType.AlternatingItem || gv.ItemType == TreeListItemType.Item || gv.ItemType == TreeListItemType.SelectedItem)
            {
                TreeListDataItem tldi = (TreeListDataItem)e.Item;
                string id = tldi["id"].Text;
                LinkButton lb = (LinkButton)gv.FindControl("lbStatus");
                Image img = (Image)gv.FindControl("imgCategory");
                HyperLink hl = (HyperLink)gv.FindControl("hlCategory");
     
                if (lb != null)
                {
                    string status = tldi["active_flag"].Text;
                    lb.Text = status.ToUpper().Equals("Y") ? "Active" : "Inactive";
                    lb.CommandArgument = id;
                    if (!status.ToUpper().Equals("Y"))
                    {
                        gv.Font.Italic = true;
                        gv.ForeColor = System.Drawing.Color.Gray;
                        lb.ForeColor = System.Drawing.Color.Gray;
                        if (hl != null)
                            hl.ForeColor = System.Drawing.Color.Gray;
                    }
                }
     
                if (hl != null && img != null)
                {
                    string targetType = tldi["targetType"].Text;
                    string imgUrl = "~/tree2/icons/";
                    string tmp2 = targetType.ToUpper();
                    if (tmp2.Equals("P"))
                        imgUrl += "folder.gif";
                    else if (tmp2.Equals("S"))
                        imgUrl += "book.gif";
                    else if (tmp2.Equals("A"))
                        imgUrl += "ball_glass_blueS.gif";
     
                    img.ImageUrl = imgUrl;
                    hl.NavigateUrl = "PSAWizard.aspx?action=edit&targettype=" + tmp2 + "&targetid=" + id;
                    if (strSelectedNodes.IndexOf("," + id + ",") >= 0)
                        gv.BackColor = System.Drawing.Color.FromArgb(204, 221, 238); //#ccddee
     
                }
                int cellsCount = gv.Cells.Count;
     
            }
        }
     
        /// <summary>
        /// required by Telerik whenever certain actions require control to reload
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        protected void rtlPortfolios_NeedDataSource(object source, TreeListNeedDataSourceEventArgs e)
        {
            if (string.IsNullOrEmpty(FilterExpression))
            {
                this.reloadPortfolio(false, string.Empty);
                rtlPortfolios.DataSource = targets;
                Session[session_manage_Target_View] = targets;
            }
            else
            {
                DataTable tmp;
                if (currentUser.HasSystemFunc(Acart.UserAdmin.Bo.User.MANAGE_PORTFOLIOS))
                {
                    tmp = targetAdmin.getManagePortfolioData_FilteredData(FilterExpression);
                    tmp.DefaultView.RowFilter = " parentid is null ";
                }
                else
                {
                    currentUser = (User)Session[GlobalConst.CURRENT_USER];
                    tmp = userManager.GetAllTopLevelTargetsOfAdminRights(currentUser.UserName);
                    tmp.DefaultView.RowFilter = FilterExpression;
                }
                rtlPortfolios.DataSource = tmp.DefaultView;
                Session[session_manage_Target_View] = tmp.DefaultView;
            }
        }
     
        /// <summary>
        /// respond to user dropping an item somewhere else in tree
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ItemCommand(object sender, TreeListCommandEventArgs e)
        {
            if (e.CommandName.Equals("CustomItemsDropped"))
            {
                TreeListDataItem tldi = (TreeListDataItem)e.Item;
                string newParentID = e.CommandArgument.ToString();
     
                int idCol = tldi.Cells.Count - 1;
                string assessmentID = tldi.Cells[idCol].Text;
     
                string jsMsg = string.Empty;
                try
                {
                    targetAdmin.moveTarget(assessmentID, newParentID);
                    jsMsg = "Move complete";
                }
                catch (Exception err)
                {
                    jsMsg = "Error moving assessment: " + err.Message;
                }
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "AssessmentMove", "alert('" + jsMsg + "');", true);
     
                TargetAdmin ta = new TargetAdmin();
                DataTable tmpTable = ta.getManagePortfolioData();
                targets = new DataView(tmpTable);
                Session[session_manage_Target_View] = targets;
                rtlPortfolios.DataSource = targets;
     
                rtlPortfolios.Rebind();
            }
        }
     
     
        protected void ClearData(object sender, EventArgs e)
        {
            {
                Session["selectedAssessmentIDs"] = hiddenValue.Value;
                Response.Redirect(Resources.PathMapping.Clear_Assessment_Data);
            }
        }
     
        /// <summary>
        ///  retrieve IDs of selected items
        /// </summary>
        /// <returns></returns>
        private string GetSelectedItems()
        {
            string retVal = string.Empty;
            string ids = string.Empty;
            string pIDs = string.Empty;
            string sIDs = string.Empty;
            string aIDs = string.Empty;
            foreach (TreeListDataItem tli in rtlPortfolios.SelectedItems)
            {
                string targetType = tli["targetType"].Text.ToUpper();
                string currID = tli["id"].Text + ",";
                if (targetType.Equals("P"))
                    pIDs += currID;
                else if (targetType.Equals("A"))
                    aIDs += currID;
                else if (targetType.Equals("S"))
                    sIDs += currID;
            }
     
            if (pIDs.Length >= 1 || aIDs.Length >= 1 || sIDs.Length >= 1)
                retVal = pIDs + "P" + sIDs + "S" + aIDs + "A";
            return retVal;
        }
     
        /// <summary>
        /// get child items associated with ID provided
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        private System.Collections.ArrayList getChildNodes(string node)
        {
            System.Collections.ArrayList tmpNodeList = new System.Collections.ArrayList();
            DataView dv = new DataView(targetAdmin.getTargetsByWhereClause(" WHERE parent_id=" + node + " and ACTIVE_FLAG <> 'D' ORDER BY LEVEL, assertion_target.nm  "));
            for (int n = 0; n < dv.Count; n++)
            {
                tmpNodeList.Add(dv.Table.Rows[n]["id"]);
            }
     
            return tmpNodeList;
        }
     
        /// <summary>
        /// populate List of IDs of selected items and any child items
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        private System.Collections.Generic.List<long> getSelectedNodes(string ids)
        {
            string tmpP = ids.Substring(0, ids.IndexOf("P"));
            string tmpS = ids.Substring(ids.IndexOf("P") + 1, ids.IndexOf("S") - ids.IndexOf("P") - 1);
            string tmpA = ids.Substring(ids.IndexOf("S") + 1, ids.IndexOf("A") - ids.IndexOf("S") - 1);
     
            tmpP = tmpP.LastIndexOf(",") != -1 ? tmpP.Substring(0, tmpP.LastIndexOf(",")) : tmpP;
            tmpS = tmpS.LastIndexOf(",") != -1 ? tmpS.Substring(0, tmpS.LastIndexOf(",")) : tmpS;
            tmpA = tmpA.LastIndexOf(",") != -1 ? tmpA.Substring(0, tmpA.LastIndexOf(",")) : tmpA;
     
            string[] tmpPlist = null;
            if (!String.IsNullOrEmpty(tmpP))
                tmpPlist = tmpP.Split(',');
     
            string[] tmpSlist = null;
            if (!String.IsNullOrEmpty(tmpS))
                tmpSlist = tmpS.Split(',');
     
            string[] tmpAlist = null;
            if (!String.IsNullOrEmpty(tmpA))
                tmpAlist = tmpA.Split(',');
     
            //get expand node list
            System.Collections.ArrayList allCheckedNodes = new System.Collections.ArrayList();
            System.Collections.ArrayList tmpSystem = new System.Collections.ArrayList();
            System.Collections.ArrayList tmpAssessment = new System.Collections.ArrayList();
            if (tmpPlist != null && tmpPlist.Length > 0)
            {
                for (int i = 0; i < tmpPlist.Length; i++)
                {
                    allCheckedNodes.Add(tmpPlist[i].ToString());
                    tmpSystem.AddRange(this.getChildNodes(tmpPlist[i].ToString()));
                }
            }
     
            if (tmpSlist != null && tmpSlist.Length > 0)
            {
                for (int i = 0; i < tmpSlist.Length; i++)
                {
                    if (!tmpSystem.Contains(tmpSlist[i].ToString()))
                        tmpSystem.Add(tmpSlist[i].ToString());
                }
            }
     
            for (int i = 0; i < tmpSystem.Count; i++)
            {
                tmpAssessment.AddRange(this.getChildNodes(tmpSystem[i].ToString()));
            }
     
            if (tmpAlist != null && tmpAlist.Length > 0)
            {
                for (int i = 0; i < tmpAlist.Length; i++)
                {
                    if (!tmpAssessment.Contains(tmpAlist[i].ToString()))
                        tmpAssessment.Add(tmpAlist[i].ToString());
                }
            }
     
            allCheckedNodes.AddRange(tmpSystem);
            allCheckedNodes.AddRange(tmpAssessment);
     
            System.Collections.Generic.List<long> listTargetId = new System.Collections.Generic.List<long>();
            if (allCheckedNodes != null && allCheckedNodes.Count > 0)
            {
                for (int i = 0; i < allCheckedNodes.Count; i++)
                {
                    if (!listTargetId.Contains(long.Parse(allCheckedNodes[i].ToString())))
                        listTargetId.Add(long.Parse(allCheckedNodes[i].ToString()));
                }
            }
            return listTargetId;
        }
     
        /// <summary>
        /// store IDs of selected nodes from search into var which is used to
        /// determine if background color should be different
        /// </summary>
        /// <param name="dataView"></param>
        private void setSelectedNodes(DataView dataView)
        {
            //System.Collections.ArrayList relativeNodeList = new System.Collections.ArrayList();
            DataRowView dataRowView;
            string pNodeId = string.Empty;
            strSelectedNodes = ",";
            strExpandNodes = ",";
            relativeNodeExpand = ",";
     
            for (int n = 0; n < dataView.Count; n++)
            {
                dataRowView = dataView[n];
                if ("S".Equals(dataRowView["targetType"].ToString()))
                {
                    if (!String.IsNullOrEmpty(dataRowView["parentId"].ToString()))
                    {
                        if (strExpandNodes.IndexOf(dataRowView["parentId"].ToString()) == -1)
                            strExpandNodes += dataRowView["parentId"].ToString() + ",";
                    }
                }
                else if ("A".Equals(dataRowView["targetType"].ToString()))
                {
                    //find Portfolio that this assessment belong to.
                    if (!String.IsNullOrEmpty(dataRowView["parentId"].ToString()))
                    {
                        //et the system node,add system node to expand nodes list
                        strExpandNodes += dataRowView["parentId"].ToString() + ",";
                        int _tmpId = int.Parse(dataRowView["parentId"].ToString());
                        DataView dv = new DataView(targetAdmin.getTargetsByWhereClause(" WHERE assertion_target.id=" + dataRowView["parentId"].ToString()));
                        if (dv != null && dv.Count > 0)
                        {
                            //get the portfolio node
                            if (dv.Table.Rows[0]["targetType"].ToString().ToUpper().Equals("P"))
                                pNodeId = dv.Table.Rows[0]["Id"] == DBNull.Value ? "" : dv.Table.Rows[0]["Id"].ToString();
                            else
                                pNodeId = dv.Table.Rows[0]["parentId"] == DBNull.Value ? "" : dv.Table.Rows[0]["parentId"].ToString();
                            if (!String.IsNullOrEmpty(pNodeId))
                            {
                                if (strExpandNodes.IndexOf(pNodeId) == -1)
                                    strExpandNodes += pNodeId + ",";
                            }
                        }
                    }
                }
                strSelectedNodes += dataRowView["ID"].ToString() + ",";
            }
     
            //get expand node list
            System.Collections.ArrayList tmpSystemExpandList = new System.Collections.ArrayList();
            System.Collections.ArrayList tmpAssessmentExpandList = new System.Collections.ArrayList();
     
            for (int j = 0; j < tmpSystemExpandList.Count; j++)
            {
                //get the expand assessment node list
                tmpAssessmentExpandList.AddRange(this.getChildNodes(tmpSystemExpandList[j].ToString()));
            }
     
            Session[session_selected_nodes] = strSelectedNodes;
            Session[session_expand_nodes] = strExpandNodes;
            Session[session_relative_nodes] = relativeNodeExpand;
     
            tmpSystemExpandList = null;
            tmpAssessmentExpandList = null;
        }
     
     
    // in the older version of Telerik that I had (from about July of 2011)
    // commented out lines of code worked. when I upgraded 2 weeks ago to the most
    // recent version, they stopped working
        protected void ApplyExpressions(object sender, RadFilterApplyExpressionsEventArgs e)
        {
            RadFilterSqlQueryProvider provider = new RadFilterSqlQueryProvider();
     
            provider.ProcessGroup(e.ExpressionRoot);
            FilterExpression = provider.Result;
            rtlPortfolios.Rebind();
            //if (!string.IsNullOrEmpty(FilterExpression))
            //    rtlPortfolios.ExpandAllItems();
            //else
            //    rtlPortfolios.CollapseAllItems();
        }
     
     
        private void LoopThruFilterControls(ControlCollection cc)
        {
            for (int i = 0; i < cc.Count; i++)
            {
                string controlType = cc[i].GetType().Name;
                if (controlType.Equals("TextBox", StringComparison.CurrentCultureIgnoreCase))
                {
                    TextBox tmp = (TextBox)cc[i];
                    ((TextBox)cc[i]).Text = tmp.Text.Trim();
                }
                LoopThruFilterControls(cc[i].Controls);
            }
        }
     
        protected void ChildItemsDataBind(object sender, TreeListChildItemsDataBindEventArgs e)
        {
            int id = Convert.ToInt32(e.ParentDataKeyValues["id"].ToString());
            if (string.IsNullOrEmpty(FilterExpression))
                e.ChildItemsDataSource = targetAdmin.getManagePortfolioData_ChildLevel(id);
            else
            {
                // DataView currentView = (DataView)Session[session_manage_Target_View];
                DataTable tmpTable = targetAdmin.getManagePortfolioData_FilteredData(FilterExpression);
                //e.ChildItemsDataSource = targetAdmin.getManagePortfolioData_ChildLevel(id);
                tmpTable.DefaultView.RowFilter = " parentid = " + id.ToString();
                e.ChildItemsDataSource = tmpTable;
            }
        }
     
        protected void rfItemCommand(object sender, RadFilterCommandEventArgs e)
        {
            if (e.CommandName == RadFilter.AddExpressionCommandName)
            {
                e.Canceled = true;
                RadFilterContainsFilterExpression item = new RadFilterContainsFilterExpression(this.rfPortfolios.FieldEditors[0].FieldName);
                (e.ExpressionItem as RadFilterGroupExpressionItem).Expression.AddExpression(item);
                this.rfPortfolios.RecreateControl();
            }
            else if (e.CommandName == RadFilter.ChangeExpressionFieldNameCommandName)
            {
                string fieldName = e.CommandArgument.ToString();
                e.Canceled = true;
                RadFilterContainsFilterExpression newExpression = new RadFilterContainsFilterExpression(fieldName);
                e.ExpressionItem.OwnerGroup.Expression.Expressions.Remove(((RadFilterSingleExpressionItem)e.ExpressionItem).Expression);
                e.ExpressionItem.OwnerGroup.Expression.AddExpression(newExpression);
                rfPortfolios.RecreateControl();
            }
        }
     
        private string FilterExpression
        {
            get
            {
                return ViewState["FilterExpression"] != null ? ViewState["FilterExpression"].ToString() : string.Empty;
            }
     
            set
            {
                ViewState["FilterExpression"] = value;
            }
        }
    }
  5. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 30 Aug 2012 Link to this post

    Hi Robin,

    I noticed that you are using load on demand in your RadTreeList. Currently the ExpandAllItems and ExpandItemToLevel methods do not work with this functionality enabled.
    We have already logged these as required improvements in the control and they will be addressed in a future release of RadTreeList, but as of current, you should either load the whole control at one time, or not use these methods.

    Regards,
    Tsvetina
    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.
  6. Robin
    Robin avatar
    23 posts
    Member since:
    Oct 2011

    Posted 30 Aug 2012 Link to this post

    OK. But why was it working before I upgraded?
  7. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 03 Sep 2012 Link to this post

    Hello Robin,

    In Q1 2012 we made improvements on the functionality (persisting the expanded and selected items with load on demand) which seem to have also caused this problem. Depending on the controls and features you use in the current project, you can consider reverting to Q3 2011 until a fix is available for this problem.

    Regards,
    Tsvetina
    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.
  8. Frederic
    Frederic avatar
    1 posts
    Member since:
    Nov 2011

    Posted 15 Mar 2013 Link to this post

    Hello,

    I tried to use ExpandAllItems() method on the RadTreeList Component (from RadControls for ASP.NET AJAX Q1 2013 version 2013.1.220.40), and only the first level is expanded.

    I saw this post which explains that this issue will be corrected in a future version, but it seems not, doesn’t it?

    Could you tell me more about this and maybe give me a working way to do a “find and select item in the hierarchy” like the example given in this post : http://www.telerik.com/community/forums/aspnet-ajax/treelist/find-a-dataitem-to-expand-in-radtreelist.aspx

    Best regards,

    Fred Chambre
  9. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 21 Mar 2013 Link to this post

    Hello Robin,

    The resolution of this issue is scheduled for the next release tentatively as it is not yet certain that the tree list control is capable of supporting out-of-the-box this functionality. Both the ExapndAll and ExpandToLevel methods are currently not working as expected.

    The work-around is to switch off the load-on-demand feature and then both methods should behave properly. If you desire to keep the load-on-demand things become more difficult, as you need to locate where in the control's hierarchy the item is located and them again programmatically expand the parent items.

    Hope it helps.

    Regards, Tsvetoslav
    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
UI for ASP.NET Ajax is Ready for VS 2017