他の誰かがこれをやろうとしている場合に備えて、これを解決策として投稿すると思いました。
ここに私のCSSがあります
<style type="text/css">
.LeftUpperCorner
{
border-left:5px solid black;
border-top:5px solid black;
}
.Top
{
border-top:5px solid black;
}
.RightUpperCorner
{
border-right:5px solid black;
border-top:5px solid black;
}
.Left
{
border-left:5px solid black;
}
.Right
{
border-right:5px solid black;
}
.LeftLowerCorner
{
border-left:5px solid black;
border-bottom:5px solid black;
}
.Bottom
{
border-bottom:5px solid black;
}
.RightLowerCorner
{
border-right:5px solid black;
border-bottom:5px solid black;
}
と私のコードビハインド:
if (e.Row.RowIndex == 2)
{
e.Row.Cells[1].CssClass = "LeftUpperCorner";
e.Row.Cells[2].CssClass = "Top";
e.Row.Cells[3].CssClass = "Top";
e.Row.Cells[4].CssClass = "Top";
e.Row.Cells[5].CssClass = "RightUpperCorner";
}
if (e.Row.RowIndex == 3 || e.Row.RowIndex == 4 || e.Row.RowIndex == 5)
{
e.Row.Cells[1].CssClass = "Left";
e.Row.Cells[5].CssClass = "Right";
}
if (e.Row.RowIndex == 6)
{
e.Row.Cells[1].CssClass = "LeftLowerCorner";
e.Row.Cells[2].CssClass = "Bottom";
e.Row.Cells[3].CssClass = "Bottom";
e.Row.Cells[4].CssClass = "Bottom";
e.Row.Cells[5].CssClass = "RightLowerCorner";
}
それは最もきれいではないかもしれませんが、これは実際に変更する必要はなく、常に同じ場所にあるので、私の単純なニーズに合っています.