0
我需要在GridView中的一个特定单元格周围设置边框。它使用下面的代码完成:Google Chrome - GridView单元格边框显示不正确
gvTrips.Rows[rowIndex].Cells[colIndex].BorderStyle = BorderStyle.Dashed;
gvTrips.Rows[rowIndex].Cells[colIndex].BorderWidth = 4;
gvTrips.Rows[rowIndex].Cells[colIndex].BorderColor = Color.DarkBlue;
gvTrips.Rows[rowIndex].Cells[colIndex].Font.Size = FontUnit.Larger;
gvTrips.Rows[rowIndex].Cells[colIndex].Font.Bold = true;
一切正常的 IE (v 11.0.9600.1823) and Firefox (v 38.0.1)。
但谷歌浏览器(v 49.0.2623.112)显示它像 this。
有谁知道如何修复Google Chrome中的单元格边框吗?或者也许有更好的方法来设置GridView中某个特定单元格的边框。
尝试使用css。 RowDataBound或PreRenderComplete – fnostro
我试图分配CssClass:gvTrips.Rows [rowIndex] .Cells [colIndex] .CssClass =“selectedCell”; where .selectedCell {border = style:dashed; border-style:dashed; border-width:2px; border-color:darkblue; font-size:larger; font-weight:bold; },但结果是一样的。还添加了类似gvTrips.Rows [rowIndex] .Cells [colIndex] .Style.Add(“border-style”,“dashed”)的样式;没有帮助。我认为单元格的样式设置正确。这个问题似乎与上一行和下一行的colspan属性有关。 –