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

Finding a Node based on two key values

3 Answers 52 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Madhu
Top achievements
Rank 1
Madhu asked on 01 Aug 2011, 01:33 PM
I want to find a node on a Treeview based on not the value of the node but based on combination of both value and category as the value field is not unique.

I am writing the following code and just want to clarify whether it's correct.

  If Not radTree.FindNode(Function(o) o.Value = NodeValue  And  o.Category = "PORT") Is Nothing Then
            node = radTree.FindNode(Function(o) o.Value = NodeValue And o.Category = "PORT")
  End If

Thanks
Madhu Rao

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 01 Aug 2011, 02:19 PM
Hi Madhu,

 I don't think the code is correct. Simply, you are currently doing the following:

If (someFunction() is Nothing) Then
   result = someFunction() 'which equals result = Nothing

Regards,
Nikolay Tsenkov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Madhu
Top achievements
Rank 1
answered on 01 Aug 2011, 03:41 PM
I have put a "Not" keyword at the beginning of the statement.
0
Nikolay Tsenkov
Telerik team
answered on 03 Aug 2011, 04:13 PM
Hi Madhu,

 Sorry about that. I didn't saw the Not in front.

Then it should fine.

Regards,
Nikolay Tsenkov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
TreeView
Asked by
Madhu
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Madhu
Top achievements
Rank 1
Share this question
or