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

[Solved] How to fix highlight selected item in panelbar

0 Answers 20 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
aibit
Top achievements
Rank 1
aibit asked on 19 Sep 2010, 07:21 PM
Hi everyboy, i'm newbie to asp.net mvc telerik, i've had a problem:

#region

 

 

Navigation for ProfileInformation 
 XmlSiteMap
objXmlSiteMapProfileInfo = new XmlSiteMap(); 
 SiteMapNode
objSiteMapNodeProfile = new SiteMapNode();

 

 

 objSiteMapNodeProfile.Title =

 

"ProfileInformation"
 SiteMapNode
obj2SiteMapNodeProfile = new SiteMapNode();

 

 

 obj2SiteMapNodeProfile.Title =

 

"Profile Information";

 

 

 obj2SiteMapNodeProfile.ActionName =

 

"Profile";

 

 obj2SiteMapNodeProfile.ControllerName =

 

"ProfileInfo";  
 objSiteMapNodeProfile.ChildNodes.Add(obj2SiteMapNodeProfile);
 objXmlSiteMapProfileInfo.RootNode.ChildNodes.Add(objSiteMapNodeProfile);
filterContext.Controller.ViewData["expert.nlqt.profileInfor"] = objXmlSiteMapProfileInfo;

 

 

#endregion

----- It's ok. -----

But, when i added "RouteValues". For example, i wanted to get all categorys with all products

private

 

 

 

static SiteMapNode GetCategorysBy_Admin()

{

    SiteMapNode objSiteMapNode = new SiteMapNode();  

 

    objSiteMapNode.Title =

 

"Category";
    SiteMapNode
objSiteMapNodeLevel1, objSiteMapNodeLevel2;

 

 

    ExpertNLQT_DBsDataContext context = new ExpertNLQT_DBsDataContext(); 
    var
categoryList = (from c in context.vw_GetCategorysBy_UserNames select c).ToList();    
    foreach
(vw_GetCategorysBy_UserName category in categoryList)

 

    {

        objSiteMapNodeLevel1 =

 

new SiteMapNode();

 

 

        objSiteMapNodeLevel1.Title = category.CategoryName;

 

       
        var
 products = (from p in context.Tbl_Product where t.FK_NewsCategoryID == category.CategoryID

 

 

 

                                select p).ToList();

 

 

        foreach (Tbl_Product objProduct in products)

 

 

        {

            objSiteMapNodeLevel2 =

 

new SiteMapNode();

 

 

            objSiteMapNodeLevel2.Title = objProduct.Name;

            objSiteMapNodeLevel2.ActionName = objProduct.Action;

            objSiteMapNodeLevel2.ControllerName = category.Controller;

            objSiteMapNodeLevel2.RouteValues.Add(

 

"acnm", objProduct.Action);
            objSiteMapNodeLevel1.ChildNodes.Add(objSiteMapNodeLevel2);

 

 

        }

        objSiteMapNode.ChildNodes.Add(objSiteMapNodeLevel1);

    }

 

 

 

 

    return objSiteMapNode;

}

 

And my problem is when i click on chill items on panelBar has RouteValues, it'll not expand parent node. How can i fix it.
Thanks

P/S: Sorry if my language is too bad.

 

Tags
General Discussions
Asked by
aibit
Top achievements
Rank 1
Share this question
or