Hi
Please help me to draw or place the dashed border to grid cell.
I need this style -----------------------. But i got __________________
row.Cells[i].Style.Borders.Bottom = new PdfPen(Color.Black, 0.2f);
PdfDocument pdf = new PdfDocument();
PdfPageBase page = pdf.Pages.Add();
float penWidth = 1;
PdfBrush brush = PdfBrushes.Red;
//Create a pen
PdfPen pen = new PdfPen(brush, penWidth);
//Set the dash style
pen.DashStyle = PdfDashStyle.Custom;
pen.DashPattern = new float[] { 2, 1 };
PdfBorders border = new PdfBorders();
border.All = pen;
PdfGridCellStyle cellStyle = new PdfGridCellStyle();
cellStyle.Borders = border;
PdfGrid grid = new PdfGrid();
grid.Columns.Add(2);
foreach (PdfGridColumn column in grid.Columns)
{
column.Width = 150;
}
grid.Rows.Add();
foreach (PdfGridRow row in grid.Rows)
{
row.Height = 30;
foreach (PdfGridCell cell in row.Cells)
{
cell.Style = cellStyle;
}
}
grid.Draw(page, 10, 10);
pdf.SaveToFile("result.pdf", FileFormat.PDF);