Grid Border Color issue


#1

George:

The following code for Bottom and Right works using the Common Grid:

Grid1.cell(row,col).style.borderBottomColor = "red"
Grid1.cell(row,col).style.borderRightColor = "red"

Left and Top do not work:

Grid1.cell(row,col).style.borderLeftColor = "red"
Grid1.cell(row,col).style.borderTopColor = "red"

Also, this code only sets the Right and Bottom border lines:

Grid1.cell(row,col).style.borderColor = "red"

Tested on PC with Chrome and IE using NSB 6.2.7.2. I think this is an issue in NSB.

Thanks, John


#2

It’s not an AppStudio issue. The top of a cell is also the bottom of the cell above it. The color of the left and top is set by the adjacent cells.

Do this instead:

Grid1.cell(row-1,col).style.borderTopColor = "red"

#3

row-1 and col -1 are my workaround solutions. Works good. But I would still like to get the cell 0 to show a top color which I cannot do (ie. row-1 on row 0 is -1 and that is a no-no). I’ve thought of putting in a dummy row 0 of no height but haven’t tried that yet.

Thanks, John


#4

This works for me:

Grid1.cell(0,0).style.borderTopColor = "red"

#5

That is the code I tried using. It works on all cell rows except row 0 where the grid does not have a title row (.titles property is blank). So this cell rests on the border of the grid. Interestingly, the .borderBottomColor property does work on the last row of the grid which is also the border to the grid. Something about this row 0.

Thanks, John


#6

More. Just found what was happening. On the top row the grid was not positioned all the way to the top. When I used the mouse to move it up just a hair it showed the top row, and it is red. I’ll have to find a way to do this programatically maybe with the scrollTo method.

Thanks, John


#7

Actually still not working:

I’m testing on an inner cell, Cell 2. Grid1.cell(0,2).style.borderTopColor = “red” works but on any other row it does not set the color.

And Grid1.cell(0,2).style.borderTopColor = “” does not work, the color stays red. To clear the color with “” I have to use borderBottom = “” on the cell below.

John


#8

The Grid is simply an HTML TABLE element. Each cell is given an ID, so the name of the 2nd cell in the 2nd row is Grid1_1_1.

To set the color back to the default, use

Grid1.cell(0,2).style.borderTopColor = "#9bb3cd"

#9

Ok, using #9bb3cd worked. I was using and empty string and it worked for all but the first row. I was unaware of #9bb3cd.

Thanks, John