Frage

I am very new to syncfusion and I am kind of stuck with this problem. I can easily populate a table if all of the rows and cells are created but I run into 'IndexOutofBounds' error once my data exceeds the number of rows in my template table. How can I add a row to a growing template table using Syncfusion in C#? I also would like to know how to handle the possiblity of the table growing to more than one page.

War es hilfreich?

Lösung

Adding a row is an easy task. After adding the row the cell paragraphs have to be added and formatted. That was the error I was running into.

IWTable table = new IWTable();
table.AddRow(True);

table.Rows[0].Cells[0].AddParagraph().AddText("sample text");

Andere Tipps

If you know the exact number of rows and columns, then you can utilize the below code to define rows and columns for a table.

IWTable table = document.LastSection.AddTable();
table.ResetCells(10, 4);

If you are not sure about the number of rows then you can use the below code to add a row dynamically.

table.AddRow();
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top