在我的 Gridview 上,我有一个 CommandField,我使用 WingDings 2 个字符而不是文本。问题是,当显示 gridview 时,在编辑(笔)和删除(垃圾桶)之间似乎有一个有趣的黑色“ block ”,我不知道如何摆脱它。
这是标记
<asp:CommandField ButtonType="Link"
ShowDeleteButton="true" DeleteText="3"
ShowEditButton="true" EditText="!"
UpdateText="P"
CancelText="O">
<ItemStyle CssClass="View3 CommandField" />
</asp:CommandField>
这是 CSSClass
#DisruptionDataGrid .CommandField {
Width: 100px;
font-family: 'WingDings 2';
color: Black;
Font-Size: 16px;
text-align: right;
}
最佳答案
好的...我现在已经解决了这个...
我将 CSSClass 分配给命令字段的 ITEMSTYLE,以便将字体应用于整个单元格。
我重构并将 CSSClass 放在 CONTROLSYTLE 上,现在“ block ”消失了。
<asp:CommandField ButtonType="Link"
ShowDeleteButton="true" DeleteText="3"
ShowEditButton="true" EditText="!"
UpdateText="P"
CancelText="O">
<ControlStyle CssClass="CommandField"/>
<ItemStyle CssClass="View3" />
</asp:CommandField>
关于c# - 为什么我的 GridView CommandField 中有一个有趣的 "block"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26669921/