Well, setting table/tableStyle gridline color is quite complicated. The first argument GridLineType of the GridColor() method by no means makes things any easier, rather it makes thing much more difficult, because the gridline types may overlap each other. In this regard, I'd prefer the same corresponding method in COM API (GetGridColor()), where are only 7 GridLineTypes there, as opposed to 12 in .NET/ObjectARX (with overlapped types).
To test actual gridline color, it would depend on whether the grid line is visible or not, which is done with SetGridVisibility() method. This only makes things even more difficult, depending on the region of cells (or whole row/rows, column/columns!!!): whether it is on top, bottom, adjacent to other cell region... So, the table style editing dialog box use a series of button to let user to select the border(gridline) is visible or not. When you set a grid color, you need to first click the last button to make sure no border is visible, and then select color, then click the button(s) to make border shown as desired.
The attached picture shows what I chose to show the title row's border in red.
and this code to test the title row gridline color:
[CommandMethod("TSTes")]
public static void TestTableStyleGridLineColor()
{
var dwg = CadApp.DocumentManager.MdiActiveDocument;
using (var tran = dwg.TransactionManager.StartTransaction())
{
var tsDict = (DBDictionary)tran.GetObject(dwg.Database.TableStyleDictionaryId, OpenMode.ForRead);
var tStyle = (TableStyle)tran.GetObject(tsDict.GetAt("STANDARD"), OpenMode.ForRead);
var titleColor1 = tStyle.GridColor(GridLineType.InnerGridLines, RowType.TitleRow).ToString(); //ByBlock
var titleColor2 = tStyle.GridColor(GridLineType.HorizontalGridLines, RowType.TitleRow).ToString(); //ByBlock
var titleColor3 = tStyle.GridColor(GridLineType.OuterGridLines, RowType.TitleRow); //ByBlock
var titleColor4 = tStyle.GridColor(GridLineType.HorizontalTop, RowType.TitleRow); // This color is RED
var titleColor5 = tStyle.GridColor(GridLineType.HorizontalGridLines, RowType.TitleRow); //ByBlock
var titleColor6 = tStyle.GridColor(GridLineType.HorizontalInside, RowType.TitleRow); //This color is RED
tran.Commit();
}
}
Hope this helps.