Menu filtering using xpath

2 posts, 0 answers
  1. Max
    Max avatar
    2 posts
    Member since:
    Nov 2012

    Posted 02 Nov 2012 Link to this post

    Hi! Im using radmenu like this:

    <Menu>
      <Item text="lvl1" Role="A">
        <Item text="lvl2" Role="A">
          <Item text="lvl3" Role="A" />
          <Item text="lvl3" Role="B" />
        </Item>
        <Item text="lvl2" Role="B" />
      </Item>
      <Item text="lvl1" Role="B">
      </Item>
    </Menu>

    <asp:XmlDataSource DataFile="LikeAbove" ID="xmlDataSource" XPath="//Item[@Role='A']" runat="server />
    <telerik:RadMenu DataSourceID="xmlDataSource" runat="Server">
      <DataBindings>
        <telerik:RadMenuItemBinding Depth="0" TextField="Text" />
        <telerik:RadMenuItemBinding Depth="1" TextField="Text" />
      </DataBindings>
    </telerik:RadMenu>

    What Im trying to do is to get all menu items with the role "A", filtering on all levels. I works on a single level using this /Item[@Role='A']but when using this approach on a multi level //Item[@Role='A'] (two slash in the beginning) it "flats out", meaning all menu nodes are being visible on the first level AND also still remains unfiltered where they used to be in the tree.
  2. Max
    Max avatar
    2 posts
    Member since:
    Nov 2012

    Posted 02 Nov 2012 Link to this post

    Or if someone has another approach how to make menu items hidden depending on their role, please share! Still I'd like to have an xml file as the datasource.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top