2016-04-22 97 views
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中某個特定單元格的邊框。

+0

嘗試使用css。 RowDataBound或PreRenderComplete – fnostro

+0

我試圖分配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屬性有關。 –

回答