on 07-04-2006 4:07 AM
Hi all,
I created a table in application. when i click add button the rows are incremented automatically. i have to generate a number sequentially with a table row. that also i did it.
I created one more button for delete row. it is also working, but i dont knoe how to set the auto generate number correctly.
Its very urgent. If any ne of u know plz let me know plz.
thanks a lot.
Thanks a lot for all your answers.
The table has first column as SNO, i generated this automatically, when i click the addrow button.
but what i want is, if i delete any one of the table rows the SNO of the deleted row have to be adjusted with other rows of the table automatically.
for ex: if i have 5 rows in the table, if i delete the 3rd row means, the SNO of 4th & 5th row have to be changed as 3 & 4 when i press the delete button.
Expect your results as early as possible.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
I think you can do something like this:
In your deletion code after code for deletion, try this:
int nodeSize = wdContext.node<table source node>.size;
for(int i = 0; i < nodeSize; i++){
wdContext.node<table source node>.setLeadSelection(i);
wdContext.node<table source node>.current<table source node>Element.set<row number attribute>(i + 1);
}
Check if this works.
Regards,
Satyajit.
Hi
Using the calculated attribute for the RowNo and using the Getter method as suggested by Armin should solve you problem of updating the SNO after deleting the rows.
In this approach you need not write any code for updating SNO.
Regards,
Ajay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you want to show a row number in the first column? If yes, add a table column, cell editor = TextView.
Add a calculated attribute "RowNumber" (integer, read-only) under the data source node "Rows".
Bind TextView.text property of the cell editor to attribute "RowNumber".
Implement the get-method:
int getRowNumber(IRowsElement element)
{
return element.index();
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Santosh,
You can try this code
int size=//your model data size
ArrayList al=new ArrayList();
for(int i=0;i<size;i++){
IXXXView.IXXElement ele=wdContext.createXXElement();//the element is which node you bind to the table
ele.setX(your needed value);
ele.sety(your needed value);
al.add(ele);
}
wdContext.nodeXX.bind(al);
regards,
Naga Raju
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U can wtite the code while adding the row itself.
wdContext.CurrentContextElement.Set<Attribute>(number);
Regards,
Vijayakhanna Raman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.