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

Reference a different attribute

1 Answer 5 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 28 Sep 2016, 07:55 PM

I have a XML file for users to click a link to display a help pdf.  The XML is using Node Text = Course and I can use Text to display the PDF in an iframe.  The XML has attributes of PDFFile and Permissions, also.

A part of the xml file:

<Node Text="System Software Requirements" PDFName="SystemSoftware" Permissions="Administrator,Installer">
    <Node Text="Client PC System Software" PDFName="SystemSoftwareClientPC" Permissions="Administrator,Installer"/>
    <Node Text="Server System Software" PDFName="SystemSoftwareServer" Permissions="Administrator,Installer"/>
</Node>

In the C# code behind, I am using Telerik.Web.UI.RadTreeNodeEventArgs e

string PDFName = e.Node.Text

to display the pdf file

I would like to use PDFName to display the PDF file and remove the link if the person is not an Administrator or Installer.  I have tried selectedName.Attribute("PDFName"), but it is giving me an error.  What attribute should I use?

Thanks,

Jeff

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 03 Oct 2016, 07:47 AM
Hello Jeff,

Instead of selectedName.Attribute("PDFName"), could you try using selectedName.Attribute["PDFName"]. The attributes are key-value based, which is why, you need to use [ ] brackets.

Regards,
Nencho
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
TreeView
Asked by
Jeff
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or