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

4 posts, 0 answers
  1. lamees
    lamees avatar
    56 posts
    Member since:
    Jul 2006

    Posted 04 Feb 2008 Link to this post

    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

  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 05 Feb 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. lamees
    lamees avatar
    56 posts
    Member since:
    Jul 2006

    Posted 05 Feb 2008 Link to this post

    But the warning message can't be removed?
  5. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 05 Feb 2008 Link to this post

    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
Back to Top