1

I want to make the corners of my GridView curvy. I tried THIS but it it gave a border extending towards the right handside. Also it would be just great if i can make each and every cell of the GridView curvy, if its not too hard to achieve. This is my GridView:

<asp:GridView  ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        onrowdatabound="GridView1_RowDataBound" BackColor="White" 
                        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" >
....something... </asp:GridView>
4

5 回答 5

3

这里有三种方法都涉及样式表。

.GridView1 {
-moz-border-radius: 15px;
border-radius: 15px;
}

对于 CSS

或在您的对象上

style= "-moz-border-radius: 15px;border-radius: 15px;"

或在 JQuery 中

$("#GridView1").css("border-radius","15px").css("-moz-border-radius","15px");
于 2013-04-17T12:58:39.417 回答
0

这就像一个魅力.... http://www.aspforums.net/Threads/749379/How-to-give-GridView-rounded-corners/Replies/1#Replies

于 2013-04-17T13:27:56.590 回答
0

CssClass="round"一个GridView1

.round
{
 border: 1px solid black;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
于 2013-04-17T13:01:43.497 回答
0

您好,您可以尝试使用 CSS

<div class="corners">
<asp:GridView> </asp:GridView>
</div> 

和CSS

.corners { border: 1px solid green; -moz-border-radius: 8px; border-radius: 8px;overflow: hidden;-webkit-border-radius: 8px;}
于 2013-04-17T13:03:24.980 回答
0

这是您可以将圆角添加到 ASP.NET GridView 的方法:

<style>
    :root{--gv-border-radius: 7px;}
    .rcgv
    {
        border-radius: var(--gv-border-radius);
        border-width: 0 !important;
    }
    .rcgv th:first-child
    {
        border-top-left-radius: var(--gv-border-radius);
    }
    .rcgv th:last-child
    {
        border-top-right-radius: var(--gv-border-radius);
    }
    .rcgv tr:last-child td:first-child
    {
        border-bottom-left-radius: var(--gv-border-radius);
    }
    .rcgv tr:last-child td:last-child
    {
        border-bottom-right-radius: var(--gv-border-radius);
    }
</style>
<asp:GridView ID="GridView1" CssClass="rcgv" runat="server" ShowFooter="true" ></asp:GridView>

希望这将帮助您为 GridView 添加时尚的边框半径。

于 2019-03-28T05:51:32.563 回答