Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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";

   // ... //

   Controls.Add(typeListMenu);
   customGridView.Columns.Add(colMenu);
share|improve this question

1 Answer 1

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{ }

Narrowed:

#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

 
discard

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.