Forum > FPSpreadsheet

TsWorksheetGrid: FrozenRows border disappears.

(1/2) > >>

deepla:
Hello,
When I change the cell border using the CellBorder and CellBorderStyle functions of the TsWorksheetGridb component, the changed cell border is overwritten on the FrozenRows border, as shown in the figure below.
Is there a way to prevent the CellBorder from being overwritten on the FrozenRows border?

This has been confirmed on both Windows and Linux. A sample program is attached.
Best regards.
Lazarus 2.0.12 / fpc 3.2.0 / Windows 10 / Lubuntu 18.04(64bit)
FPSpreadsheet 1.13(r-8058)

wp:
Please test the new revision. Or, if you don't use trunk, change the procedure TsCustomWorksheetGrid.DrawCellBorders in unit fpspreadsheetgrid in the following way:

* Find the comment "Left border". In the following line add " and (ACol <> FixedCols)":

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    // Left border    if GetBorderStyle(ACol, ARow, -1, 0, ACell, bs) and (ACol <> FixedCols) then
* Find the comment "Right border". In the following line add " and (ACol + 1 <> FixedCols)":

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    // Right border    if GetBorderStyle(ACol, ARow, +1, 0, ACell, bs) and (ACol + 1 <> FixedCols) then

deepla:

--- Quote from: wp on July 11, 2021, 10:36:38 am ---Please test the new revision. Or, if you don't use trunk, change the procedure TsCustomWorksheetGrid.DrawCellBorders in unit fpspreadsheetgrid in the following way:

* Find the comment "Left border". In the following line add " and (ACol <> FixedCols)":

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    // Left border    if GetBorderStyle(ACol, ARow, -1, 0, ACell, bs) and (ACol <> FixedCols) then
* Find the comment "Right border". In the following line add " and (ACol + 1 <> FixedCols)":

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    // Right border    if GetBorderStyle(ACol, ARow, +1, 0, ACell, bs) and (ACol + 1 <> FixedCols) then
--- End quote ---
Thank you for your fixing.
However, if you scroll the sheet to the right, the same thing happens when the borders of the second and subsequent cells overlap the borders of FrozenCols.
To make this happen, add the following.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---sWorksheetGrid1.Options := sWorksheetGrid1.Options                            - [goSmoothScroll]                            + [goThumbTracking];sWorksheetGrid1.DefaultColWidth := 30;Best regards.
Lazarus 2.0.12 / fpc 3.2.0 / Windows 10 / Lubuntu 18.04(64bit) / FPSpreadsheet 1.13(r-8059)

wp:
Another attempt in the new revision... (if you don't use svn replace the "FixedCols" of the previous patch by "LeftCol").

BTW, quite some time after I wrote this, I feel that setting borders of neighboring cells is still very confusing. What do you think? Suppose one cell, say (r=6, c=6) with a border at the right, and the left neighboring cell (r=6, c=7) gets a border at the right as well, aren't you expecting the left neighboring cell to have both a left and right border? In the worksheet this is true, but in the worksheetgrid, the left border of (r=6, c=7) is removed.

deepla:

--- Quote from: wp on July 11, 2021, 04:33:39 pm ---Another attempt in the new revision... (if you don't use svn replace the "FixedCols" of the previous patch by "LeftCol").

BTW, quite some time after I wrote this, I feel that setting borders of neighboring cells is still very confusing. What do you think? Suppose one cell, say (r=6, c=6) with a border at the right, and the left neighboring cell (r=6, c=7) gets a border at the right as well, aren't you expecting the left neighboring cell to have both a left and right border? In the worksheet this is true, but in the worksheetgrid, the left border of (r=6, c=7) is removed.

--- End quote ---
I had the same feeling during programming using the border by grid methods. Looking at this sample program, I think that the border by the worksheet method is easier to use than the border by the grid method.
Immediately, when CellBorder and FrozenBorder overlap, FrozenBorder disappears, but I solved it with the following settings.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---sWorksheetGrid1.FrozenBorderPen.Width: = 2;If the Frozen Border line width is larger than the Cell Border line width, the Frozen Border line will not disappear completely.
Thank you for fixing this component.
Lazarus 2.0.12 / fpc 3.2.0 / Windows 10 / Lubuntu 18.04(64bit) / FPSpreadsheet 1.13(r-8060)

Navigation

[0] Message Index

[#] Next page

Go to full version