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

Databinding and Security Trimming

1 Answer 51 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Brian Goldman
Top achievements
Rank 2
Brian Goldman asked on 20 Jul 2010, 10:07 PM
Hello,
I'm trying to use the panel bar for a site navigation and still be able to use custom attributes to specify properties for the panel bar such as ImageURL, HoverImageURL, etc but still have security trimming.
My first attempt was with a site map provider but I can't define custom attributes in the web.sitemap file.
Then I tried an xml file and then security trimming didn't work.

Is there anyway to use something other than the sitemapprovider and still have security trimming.

Thanks,
Brian

1 Answer, 1 is accepted

Sort by
0
Brian Goldman
Top achievements
Rank 2
answered on 22 Jul 2010, 02:06 AM
Well after several hours of trial and error and searching I think I have it. In case someone else needs this, here is what I did.

In your web.sitemap file you would add the attribute for example for the expanded setting
<siteMapNode title="Settings"  description="Global Settings" roles="Administrator" expanded="true">


then in your code you would add this:
protected void RadPanelBar1_ItemDataBound(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)
       {
         e.Item.Expanded = Boolean.Parse(((System.Web.SiteMapNode)e.Item.DataItem)["expanded"]);
          
       }

It's just that simple.
Tags
PanelBar
Asked by
Brian Goldman
Top achievements
Rank 2
Answers by
Brian Goldman
Top achievements
Rank 2
Share this question
or