Hello Support.
From an answer to an earlier question about rounded corners (on a button) the advice was to use:
this.button1.CssStyle=”border-radius:5px”;
This works well for buttons but when I set the same CssStyle on a DataGridView only the bottom two corners are rounded. The top two corners remain square. It looks like the column label row does not listen to the CssStyle. Is there any way around this ? Any easy way to get a DataGridView with all 4 corners rounded ?
Thank you
Andrew
Hello Julie.
Thank you for your answer, I put the css line into the theme file that I use but only have partial success with it. When I have a datagridview with no data and no column headers I can see the nice rounded corners on all 4 corners, looks good !. But when I have a row of data in the datagridview the row does not have rounded corners and, on screen, overwrites the datagridview border and gives it square corners. Likewise if I have column headers – the column header row has square corners and you can’t see the rounded corners of the datagridview anymore. I have attached an image which might make things clearer.
Andrew
You can do this via a theme/ theme mixin.
This is the code you need:
"css": "{\"border-radius\":\"5px\"}"
You need to use this in the “table” like so:
"table": {
"states": {
"default": {
"styles": {
"width": [1, 1, 1, 1],
"style": ["solid", "solid", "solid", "solid"],
"color": "windowFrame",
"css": "{\"border-radius\":\"5px\"}"
},
"properties": {
"indent": 20,
"rowHeight": 32,
"headerCellHeight": 32,
"backgroundColor": "window",
"headerBackColor": "window"
}
},
I’ve attached the full theme file (it’s a modified version of the Bootstrap=4 theme) and a screenshot of what this looks like on the datagridview in the theme builder.
Hope this helps,
Julie
Please login first to submit.