cancel
Showing results for 
Search instead for 
Did you mean: 

Table Columns as Dropdown by Index

Former Member
0 Kudos

Hi,

In a table of each row of a particular column i want the dropdown and each with different values.

Here the code is attached for

get the data from the model node and copy into the Parent node. and for one particular child the values are hard coded.

here all the values appear for the first row and not for the others.

IWDNodeElement Modeldata = wdContext.current<modelnode>Element();

int cnt = wdContext.node<ModelNode>.size();

for (int i = 0; i < cnt ; i++ )

{

wdContext.nod<modelnode>.setLeadSelection(i);

I<ParentNode>Element Pele = wdContext.node<ParentNode>.create<parentnode>Element();

WDCopyService.copyCorresponding(modeldata , Pnode);

for ( int j = 0; j<3 ; j++)

{

I<childnode>Element cele = wdContext.node<childnode>.create<childnode>Element();

cele.set<childnode>("BG"(i1)(j1));

wdContext.node<parentnode>.node<childnode>.addElement(BuildGP);

}

wdContext.nodePropertiesUnalloc().addElement(Prop);

}

Thanks

Vijaya

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This question has been answered several times in this forum.

Context:

Rows (cardinality 0:N)

--Items (cardinality 0:N, selection 0:1, singleton=false)

-


Text: string

Data binding:

Table.dataSource -> Rows

TableColumn.TableCellEditor(DropDownByIndex).texts -> Text

A non-singleton child node exists per parent-<b>element</b>. In the above context, every "Rows"-element has its own "Items"-node.

To add the items for a row, you have to write something like

IRowsElement row = ...;
for (int i = 0; i < numItems; ++i)
{
  IItemsElement item = row.nodeItems().createItemsElement();
  row.nodeItems().addElement(item); 
  item.setText("Item #" + i);
}

Armin

Former Member
0 Kudos

Thank you Armin, its working fine in our object.

Former Member
0 Kudos

vijayalakshmi,

plz close thread and consider rewarding points for valuable answers.

VS

Former Member
0 Kudos

Sorry for the trouble, issue was solved.

Former Member
0 Kudos

Add node element "row" to its node before accessing its child node:

IRowsElement row = wdContext.createRowsElement();
wdContext.addElement(row);
...

Armin

Former Member
0 Kudos

Thanks for the quick response Armin, you are right I missed to add node element "row"

Former Member
0 Kudos

there is a slight change in the code which was tried. still it gives the dropdown list only for the first row column.

IWDNodeElement Modeldata = wdContext.current<modelnode>Element();

int cnt = wdContext.node<ModelNode>.size();

for (int i = 0; i < cnt ; i++ )

{

wdContext.nod<modelnode>.setLeadSelection(i);

I<ParentNode>Element Pele = wdContext.node<ParentNode>.create<parentnode>Element();

WDCopyService.copyCorresponding(modeldata , Pele);

wdContext.node<parentnode>.addElement(Pele);

for ( int j = 0; j<3 ; j++)

{

I<childnode>Element cele = wdContext.node<childnode>.create<childnode>Element();

cele.set<childnode>("TXT"(i1)(j1));

wdContext.node<parentnode>.node<childnode>.addElement(cele);

}

}

Thanks in advance

vijaya