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

Root Item with No Child Item Border Issue

2 Answers 35 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Bernard Bobinski
Top achievements
Rank 2
Bernard Bobinski asked on 26 Jan 2011, 03:45 AM

I have a RadMenu (with a custom skin - css code below) that has a root list with some of the root items having one level of child items. The issue that I have is that I have a border set to enclose the child items via a custom skin and it partially displays when you hover a root item that has no child items assigned to it (See attached images - NoChildItems.jpg and ChildItems.jpg). I changed the border color to red so that it would stand out during testing. Is there any way to rectify this or does the border have to be the same color as the root item background?

 

 

/* SVPD Menu / Simple> */
  
/* for root items */
div.RadMenu_SVPD ul.rmRootGroup 
{
  
}
       
div.RadMenu_SVPD .rmLink
{
    color: #ffffff;
    padding-left: 15px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: normal;
    text-decoration: none;
    height: 20px;
}
        
/* for hover, focused, expanded items */
div.RadMenu_SVPD .rmItem .rmLink:hover
{
    color: #91c8ff;
    cursor: pointer;
}
div.RadMenu_SVPD .rmItem .rmFocused,
div.RadMenu_SVPD .rmItem .rmSelected,
div.RadMenu_SVPD .rmItem .rmExpanded
{
  
}
       
/*for subitems */
       
div.RadMenu_SVPD .rmGroup 
{
    padding-top: 4px !important;
    border: 1px solid #ff0000;
    background: #003c77 url('Menu/rmVSprite.png') repeat-y;
}
       
div.RadMenu_SVPD .rmGroup .rmLink 
{
    color: #ffffff;
    padding-right: 0px !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: normal;
    text-decoration: none;
    float: left;
}
  
div.RadMenu_SVPD .rmGroup .rmText
{
    Padding-left: 10px !important;
}
        
/* for hover, focused, expanded items */
div.RadMenu_SVPD .rmGroup .rmItem .rmLink:hover
{
    color: #91c8ff;
    cursor: pointer;
}
div.RadMenu_SVPD .rmGroup .rmItem .rmFocused,
div.RadMenu_SVPD .rmGroup .rmItem .rmSelected,
div.RadMenu_SVPD .rmGroup .rmItem .rmExpanded 
{
}

2 Answers, 1 is accepted

Sort by
0
Bernard Bobinski
Top achievements
Rank 2
answered on 26 Jan 2011, 02:48 PM
Forgot to add:

OS: Windows 7
Development: MS Visual Studios 2010
Telerik: ASP.Net AJAX Q3 2010
Browser: IE 8
.Net 4.0
0
Bernard Bobinski
Top achievements
Rank 2
answered on 26 Jan 2011, 03:26 PM
Disregard. I solved it. I was loading the menu from a database and needed an extra arguement to filter out whether a child item was blank in the database.
protected void RadMenu1_Load(object sender, EventArgs e)
   {
       // Load Data
       using (OleDbConnection con = new OleDbConnection(connectionString))
       {
           OleDbCommand cmd = new OleDbCommand("SELECT DISTINCT rootitem, rootlink, rootsort FROM leftmenu ORDER BY rootsort", con);
           OleDbDataReader dr = null;
           string getRootName = "";
           string getRootLink = "";
           string getChildName = "";
           string getChildLink = "";
           con.Open();
           dr = cmd.ExecuteReader();
           if (dr.HasRows == true)
           {
               while (dr.Read())
               {
                   if (!dr.IsDBNull(0)) getRootName = dr.GetString(0).Trim(); // Root Name
                   if (!dr.IsDBNull(1)) getRootLink = dr.GetString(1).Trim(); // Root URL Link
                   // Create Root Menu
                   RadMenuItem rootItem = new RadMenuItem();
                   rootItem.Text = getRootName;
                   if (!getRootLink.Equals("")) rootItem.NavigateUrl = "~/" + getRootLink + "?h=" + SetHt;
                   using (OleDbConnection con2 = new OleDbConnection(connectionString))
                   {
                       OleDbCommand cmd2 = new OleDbCommand("SELECT childitem, childlink FROM leftmenu WHERE rootitem = '" + getRootName + "' ORDER BY childsort, childitem", con2);
                       OleDbDataReader dr2 = null;
                       con2.Open();
                       dr2 = cmd2.ExecuteReader();
                       if (dr.HasRows == true)
                       {
                           while (dr2.Read())
                           {
                               if (!dr2.IsDBNull(0)) getChildName = dr2.GetString(0); // Child Name
                               if (!dr2.IsDBNull(1)) getChildLink = dr2.GetString(1); // Child URL Link
                               if (!getChildName.Equals("")) // ******* This is the extra arguement required *****
                               {
                                   RadMenuItem childItem = new RadMenuItem();
                                   childItem.Text = getChildName;
                                   childItem.NavigateUrl = "~/" + getChildLink + "?h=" + SetHt;
                                   rootItem.Items.Add(childItem); // Add Child Item
                               } // End if
                               // Reset Items
                               getChildName = "";
                               getChildLink = "";
                           } // End While Loop
                       } // End If
                       else
                       {
                           // Do Nothing
                       } // End Else
                       con2.Close();
                   } // End Using
                   RadMenu1.Items.Add(rootItem); // Add Root Menu Item
                   // Reset Items
                   getRootName = "";
                   getRootLink = "";
               } // End While Loop
           } // End If
           con.Close();
       } // End Using
   }// End Method
Tags
Menu
Asked by
Bernard Bobinski
Top achievements
Rank 2
Answers by
Bernard Bobinski
Top achievements
Rank 2
Share this question
or