Hi,
I have the same issue as described here:
viewtopic.php?f=2&t=2970&view=nextAs I wanted to adapt the solution to my code I noticed that the KeepWithNext does not exist.
Can someone explain how to use the KeepWithNext which is mentioned in the link?
For explanation:
I will get a list<sting> from an other class.
Every 10th entry a new row will be written.
There is a header row which should be repeated when a page break occurs. So the HeadingFormat = true. This is not shown in the code below.
Code:
for (int i = 0; i < (Input.Count()-28)/10 ; i++)
{
DRow = DataTable.AddRow();
DRow.Borders.Top.Visible = false;
DRow.Borders.Bottom.Visible = true;
DRow.Borders.Left.Visible = false;
DRow.Borders.Right.Visible = false;
DRow.Borders.Color = Colors.DarkGray;
DRow.Height = "0.75cm";
cell = DRow.Cells[0];
int Iconsize = 18;
imgIcon.Height = (Iconsize * 0.75).ToString() + "pt";
cell.Add(imgIcon.Clone());
cell.VerticalAlignment = VerticalAlignment.Center;
cell = DRow.Cells[1];
cell.AddParagraph(Input[29+(i*10)]);
cell.VerticalAlignment = VerticalAlignment.Center;
cell = DRow.Cells[2];
cell.Add(imgIcon.Clone());
cell.VerticalAlignment = VerticalAlignment.Center;
cell = DRow.Cells[3];
cell.AddParagraph(Input[30+(i*10)]);
cell.VerticalAlignment = VerticalAlignment.Center;
cell = DRow.Cells[4];
...
...
...
if (HighlightRowFlag == true)
{
DRow.Shading.Color = Colors.LightGray;
}
HighlightRowFlag = !HighlightRowFlag;
}
The code is working perfectly fine except for the alternating shading of rows.