on 11-12-2005 2:02 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.