简体   繁体   English

更改gridview的边框颜色

[英]change border color of gridview

Using Gridview to display a table stored in the DB, I want to change the border color to #dbddff. 使用Gridview显示存储在DB中的表,我想将边框颜色更改为#dbddff。 It wont accept this or dbddff, what can I do? 它不会接受这个或dbddff,我该怎么办?

<asp:GridView ID="GridView1" runat="server" AllowPaging="true" BorderColor="dbddff" AllowSoerting="true" Width="100px"  AutoGenerateColumns="false" DataSourceID="GridDataSource"> 

Thanks 谢谢

尝试将BorderWidth属性设置为1px。

<asp:GridView ID="GridView1" runat="server" AllowPaging="true" BorderWidth="1px" BorderColor="dbddff"  AllowSoerting="true" Width="100px"  AutoGenerateColumns="false" DataSourceID="GridDataSource"> 

Your code 你的代码

The issue is the missing # in the border color. 问题是边框颜色中缺少#。 This should work 这应该工作

Could you apply the color via style or stylesheet? 你可以通过样式或样式表应用颜色吗?

#GridView1 {
    border: solid 1px #dbddff;
} 

You can either specify the color or use the hex code, which in this case you need the # before the hex code. 您可以指定颜色或使用十六进制代码,在这种情况下,您需要在十六进制代码之前的#。 The border has to be at least 1 px in size in order for the color to show up. 边框必须至少为1像素,以便显示颜色。

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

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