Skip to content

Add border styles for top and left in VisualCell#271

Open
ravetroll wants to merge 2 commits into
anmcgrath:mainfrom
ravetroll:main
Open

Add border styles for top and left in VisualCell#271
ravetroll wants to merge 2 commits into
anmcgrath:mainfrom
ravetroll:main

Conversation

@ravetroll

Copy link
Copy Markdown

The cell formatting is incomplete for the top border and left border of the cell. This change implements the styling that is missing

@anmcgrath

Copy link
Copy Markdown
Owner

Hey ravetroll thanks for the PR. The SetFormatCommand already handles setting adjacent cell borders for left/top borders, although I suppose it doesn't work for cells in the first row/column. We should consider only rendering the actual top/left borders for the first visual cell in either axis.

@ravetroll

Copy link
Copy Markdown
Author

`
public static void OutlineCell(SheetCell _selection, string color, int width)
{

_selection.Format = new CellFormat()
{

    BorderBottom = new Border()
    {
        Color = color,
        Width = width
    },
    BorderTop = new Border()
    {
        Color = color,
        Width = width
    },
    BorderLeft = new Border()
    {
        Color = color,
        Width = width
    },
    BorderRight = new Border()
    {
        Color = color,
        Width = width
    }

};

}
`

When I run this code i use for drawing borders around a single cell, only the bottom and right border is drawn.

@ravetroll

Copy link
Copy Markdown
Author

I am looking into what can be done to put borders inside the region, rather than put borders on the adjacent cell

@ravetroll ravetroll left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I made a little test app BlazorApp1, and I made some changes to SetFormatCommand on top of the VisualCell styling changes I made previously. I wanted to make the surrounding cells format the line on the inside of the cells in the selected range and I have achieved that. I have broken some of test tests regarding formatting but at least you can see a working example of how I think the border formatting for surroundings should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants