We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Inserting Rows into Tables

Hi,

I'm trying to insert a row into a table, but I want it to be in the middle of the table. The reason behind this is that the the last row of the table contains 2 cells whereas every where else in the table it has 3 cells.
When I use the table.AddRow(true) method, it adds the row to the very bottom of the table. Is there a way to add them to the anywhere on the table?

Thanks
Leo


1 Reply

BP Bhuvaneswari P Syncfusion Team November 19, 2008 06:57 AM UTC

Hi Leo,

Thank for your interest in Syncfusion products.

We can insert the row in middle of the table by using the Insert method. But there is an issue with inserting rows into the existing table. We suspect this issue to be a defect and we have forwarded this to our development team for more analysis. We will update you in two business days with more details.

You can use the below methods to insert the row into the table once the issue is fixed.

//To inserts the row at specified row index of the table
WTableRow row = new WTableRow(doc);
row.Height = 30;
table.Rows.Insert(2, row );

//Will add row at the bottom of the table
WTableRow row = new WTableRow(doc);
table.Rows.Add(row);
row.Height = 20;

//or add row at the bottom of the table
table.AddRow(true);


Please let me know if you have any other questions.

Best Regards,
Bhuvana



Loader.
Live Chat Icon For mobile
Up arrow icon