Posted 8 November 2022, 8:52 pm EST
Hi,
The desired behavior cannot be achieved directly and based on some conditions.
For this, we need to set the CellStyle in the FlexGrid tag and set the border in PrepareCellStyle. Also, set the BorderColor to null.
Further, we need to set the cell margin to 0. Please refer to the following code snippet for reference:
<FlexGrid CellFactory="factory" CellStyle="@("border-top-color:red;border-bottom-color:blue;border-left-color:green;border-right-color:black;")">
</FlexGrid>
public class MyCellFactory : GridCellFactory
{
public override void PrepareCellStyle(GridCellType cellType, GridCellRange range, C1Style style, C1Thickness internalBorders)
{
base.PrepareCellStyle(cellType, range, style, internalBorders);
if(cellType == GridCellType.Cell )
{
C1Thickness borderWidth = ((C1Thickness)style.BorderWidth);
var leftBorder = borderWidth.Left !=null ? 5.0 : borderWidth.Left;
style.BorderWidth = new C1Thickness(7, 7, 10, 10);
style.BorderColor = null;
}
}
}
<style>
.flexgrid-cell{
margin:0 !important;
}
</style>
Regards,
Manish Gupta