cancel
Showing results for 
Search instead for 
Did you mean: 

Adding rows in table

Former Member
0 Kudos

Hi everybody,

Usually when we add rows the rows are getting added at the end of the table.Now I have a requirement such that the rows should be added inbetween.For instance if the row 2 is selected and if I click on the button add row then the row should get added after 1st row before 2nd row.Please help me in approaching this.

Regards

Sharanya.R

Accepted Solutions (1)

Accepted Solutions (1)

former_member188498
Active Participant
0 Kudos

Hi,

try something like this:


int insertPosition = wdContext.nodeTable().getLeadSelection()-1>0?wdContext.nodeTable().getLeadSelection()-1:0;
 
ITableElement element = ...
 
wdContext.nodeTable().addElement(insertPosition, element);

Regards,

Ladislav

Answers (0)