on 11-14-2005 6:17 PM
Hi,
Is there a way i can initialize all the context values of a view. I mean when i click "Reset" all the values should be cleared at one shot instead of setting each value attribute to space.
wdContext.invalidate()
It clears all the values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aditya,
Whether you use wdContext.invalidate() or wdContext.reset(), all the elements of the entire context will be deleted and hence the table will be disbaled since it's datasource node has no elements. Each row of a table corresponds to an element in it's datasource node. If you create n elements for the node, those many rows will be enabled. So when you remove all the elements of the node, all the rows of the table will also be disbaled. So you have two options here:
1) After removing the elements, create as many of them as required with the default values.
2) Instead of removing the elments, explicitly access each attribute and set it's value to null or space. It will involve just a for loop:
IPrivate<View_name>.I<node_name>Element elmt;
for(int i=0;i<wdContext.node<node_name>().size();i++)
{
elmt = wdContext. node<node_name>().get<node_name>ElementAt(i);
elmt.set<parameter1>("");
elmt.set<parameter2>("");
.
.
}
Hope this helps,
Best Regards,
Nibu.
(Please take care to close your solved problem's threads by awarding appropriate points . If you haven't got a solution for your problems, please update the forum on their status. Kindly consider awarding points for helpful answers on SDN !)
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.