This is a migrated thread and some comments may be shown as answers.

'Telerik.WinControls.UI.RadTreeNode.Index' is obsolete

3 Answers 73 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
lamees
Top achievements
Rank 1
lamees asked on 04 Feb 2008, 04:59 PM
Hey,
    When I use the property TreeView.Nodes[0].Index to get the index value of a specific node, I got the following warning message

'Telerik.WinControls.UI.RadTreeNode.Index'

is obsolete: 'The setter of the Index property will be removed.'

Is there an alternative for this property?

Thank you

3 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 05 Feb 2008, 08:23 AM
Hello lamees,

As the message says, only the setter of the Index property will be removed as this property is now set internally.
It is perfectly safe to use the getter of the Index property.

If for some reason you want to move the node to another position in the collection you could use the methods of the RadTreeNodeCollection class.

In the meantime we consider changing the warning message to be more descriptive.

Kind regards,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
lamees
Top achievements
Rank 1
answered on 05 Feb 2008, 01:51 PM
But the warning message can't be removed?
0
Jordan
Telerik team
answered on 05 Feb 2008, 03:35 PM
Hello,

The warning will disappear when we remove the setter and the Obsolete attribute.

Or you can suppress it by writing before using the property:
#pragma warning disable 0618

And if you like you can enable the warning again with:
#pragma warning restore 0618.

In the example above 0618 is the number of the warning. It can be seen in the Output window of Visual Studio.

All the best,
Jordan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Treeview
Asked by
lamees
Top achievements
Rank 1
Answers by
Jordan
Telerik team
lamees
Top achievements
Rank 1
Share this question
or