SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created SPGridView and added one SPMenuField as the first column and some BoundFields. Then I added MenuTemplate to the first column. But there are rectangles with white color border (look at the picture). I want to hide them. How can I do it ?

SPGridView problem with visualization

Here is the code I use:

   SPMenuField colMenu = new SPMenuField();
   colMenu.HeaderText = "Title";
   colMenu.TextFields = "Title";
   colMenu.MenuTemplateId = "TitleListMenu";
   colMenu.NavigateUrlFields = "WebId, ListId, ID";
   colMenu.NavigateUrlFormat = "default.aspx?WebID={0}&ListID={1}&ListItemID={2}";
   colMenu.TokenNameAndValueFields = "Param1=ID";
   colMenu.SortExpression = "Title";

   MenuTemplate typeListMenu = new MenuTemplate();
   typeListMenu.ID = "TitleListMenu";

   // ... //

share|improve this question
up vote 1 down vote accepted

Use the build-in webdeveloper tool in the browser (F12) and inspect the element.
I'm pretty sure it's just border around the contextmenu div.

Add the below to your CSS file and brand it. Beware that this will change it for all contextmenus on your site using your CSS file, so you might want to narrow it down to your custom list.

Over all:

.s4-ctx{ }


#TitleListMenu .s4-ctx{ }
share|improve this answer
Yes, thank you. The build-in webdeveloper tool helped me to find this element. It has <td> tag. – andDaviD Jul 19 '12 at 9:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.