c# - 如何将 gridview 的形状更改为圆形?

标签 c# asp.net css gridview

如何将 GridView 的方形更改为圆形,或者是否可以在圆形对象或图片上显示 gridview?

我已经尝试过:-

1-add cssclass to the gridview where css class had a line of code for a background image
2-applied headerclass css to the gridview and gave the image source there.
3-applied a backimage property to the Grid.
(the image in all the 3 cases was a circle)

CSS 是

    .circle{ background:url(circle.png); opacity:0.5;height:176px;width:176px;} 

我正在尝试在 visual studio 10 的 aspx 页面中插入 GridView

但似乎没有什么能按我想要的方式工作。在前两种情况下,GridView 单元格未对齐。

如果可能,请给我一个正确的方法。

提前致谢

最佳答案

你不必使用图像,例如使用 CSS 形成一个圆圈

.circle {
    width: 320px;
    height: 320px;
    background: LightPink;
    -moz-border-radius: 160px;
    -webkit-border-radius: 160px;
    border-radius: 160x;
}

另外,不要改变网格本身的形状——这可能会导致错位。将网格放置在应用了上述类的 DIV 中。

演示:http://jsfiddle.net/pnFGt/

关于c# - 如何将 gridview 的形状更改为圆形?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18872077/

相关文章:

c# - 具有共享 IP 地址的 Web 服务器上的 MySQL 数据库的连接字符串 - C#

c# - 什么会导致 UDP 套接字上的 ConnectionReset?

c# - "default"通用约束有什么作用?

asp.net - http 服务器的责任与使用此服务器托管的 Web 应用程序的责任

css - 何时使用 Bootstrap 类属性值 ".embed-responsive-item"?

html - 使用 Bootstrap 设计 div

c# - 使用 Thinktecture Identity Server 时保留 OAuth2 不记名 token

c# - URLDecode 后 QueryString 格式错误

c# - ASP.Net Dropdownlist ListItem (Enabled=false) 未显示在页面中

javascript - 在生产中使用 css/javascript source-maps 的性能影响?