0

I want to change the color of SiteMapNode dynamically at runtime.

I am going to change it from the master page.

Some part of code goes like this :

C1.Web.Command.C1WebMenuItem item = new C1.Web.Command.C1WebMenuItem(); C1.Web.Command.C1WebMenuItem subitem = new C1.Web.Command.C1WebMenuItem(); C1.Web.Command.C1WebMenuItem msgitem = new C1.Web.Command.C1WebMenuItem(); C1.Web.Command.C1WebItemCollection collection = C1WebMenu1.Items;

    if (collection.Count > 0)
    {
        item = (C1WebMenuItem)C1WebMenu1.Items[0];
        item.CreateChildGroup();
        msgitem = (C1WebMenuItem)C1WebMenu1.Items[13];
        msgitem.Text = msgitem.Text + "(1)";
        ----------------- i want to change the color of msgitem.text------------
        if (Session["intUserId"] != null)
        {





            dsAccessed = objSASiteMaster.smaSPGetLastAccessedCases(Session["intUserId"].ToString());
            if (dsAccessed.Tables.Count > 0)
            {
                if (dsAccessed.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < dsAccessed.Tables[0].Rows.Count; i++)
                    {
                        DataSet dsCase = objSASiteMaster.GetCaseByCaseID(dsAccessed.Tables[0].Rows[i]["lacnCaseID"].ToString());

                        using (DataTable dtCase = dsCase.Tables[0])
                        {
                            if (dtCase.Rows[0]["GroupID"].ToString() == "149")
Bebu
  • 65
  • 3
  • 14
  • Question.. do you use Master pages at all.. have done this dynamically changing menue items on MasterPages so I am only assuming that the same should be possible when doing this using a sitemap – MethodMan Dec 20 '11 at 17:36
  • I have added submenu items to the menu dynamically.... but i need to change the color of sitemapnode. – Bebu Dec 20 '11 at 17:48
  • hold on let me look at your code one more time.. – MethodMan Dec 20 '11 at 17:53
  • are you checking or trying to change the color based on the menuItem that was clicked..? if so do a Switch on the following as an example to maybe help you get started.. I will paste an example below in the answer as something you may want to try but does not mean it's a complete or accurate answer.. – MethodMan Dec 20 '11 at 17:57
  • 1
    http://msdn.microsoft.com/en-us/library/ms178425.aspx or http://www.codeproject.com/KB/webforms/MenuControlSelectedItem1.aspx?msg=3289269 or http://msdn.microsoft.com/en-us/library/aa581782.aspx – MethodMan Dec 20 '11 at 18:04

0 Answers0