简体   繁体   English

在SPGridView中可视化SPmenuField

[英]Visualization SPmenuField in SPGridView

I have created SPGridView and added one SPMenuField as the first column and some BoundFields . 我创建了SPGridView并添加了一个SPMenuField作为第一列以及一些BoundFields Then I added MenuTemplate to the first column. 然后,我将MenuTemplate添加到第一列。 But there are rectangles with white color border. 但是也有带有白色边框的矩形。 I want to hide them. 我想把它们藏起来。 How can I do it ? 我该怎么做 ?

问题网格视图

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

Here is the answer on my question. 是我的问题的答案。 It is nesseccery to narrow the .ms-menuimagecell css class. 缩小.ms-menuimagecell css类的范围是必要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM