Hiding separators in RadGrid HeaderContextMenu

4 posts, 1 answers
  1. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 18 May 2012 Link to this post

    Hi,

    I have a RadGrid (version Q1 2012) in which I hide some items in the headercontextmenu :

    protected void HeaderContextMenu_ItemCreated(object sender, RadMenuEventArgs e)
            {
                switch (e.Item.Value)
                {
                    case "GroupBy":
                    case "UnGroupBy":
                    case "bottomGroupSeperator":
                    case "BestFit":
                    case "bestFitSeparator":
                    case "ColumnsContainer":
                    case "filterMenuSeparator":
                        e.Item.Attributes.Add("style", "display: none");
                        break;
                    default:
                        break;
                }
            }


    The items are hidden except for the separators I want to hide. The result I see is four separators in stead of one.
    How can I hide these separators?

    Paul

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 May 2012 Link to this post

    Hi,

    Try the following CSS to hide the Separator.

    CSS:
    .RadMenu .rmSeparator, .RadMenu .rmSeparator:after
    {
        height:0px !important;
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul Evers
    Paul Evers avatar
    52 posts
    Member since:
    Oct 2011

    Posted 18 May 2012 Link to this post

    I don't want to hide all the separators. I only want to hide 3 out of four to hide.

    Paul
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 May 2012 Link to this post

    Hello Paul,

    Try setting the following CSS.
    CSS:
    .RadMenu .rmSeparator, .RadMenu .rmSeparator:after
    {
        height:1px !important;
        margin-top:-2px !important;
        overflow:visible !important;
    }

    Thanks,
    Princy.
Back to Top