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

Find <td> inside RadMenu

1 Answer 68 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Terri-Lynn
Top achievements
Rank 1
Terri-Lynn asked on 21 Oct 2011, 09:26 PM
Hi all!  I have a simple RadMenu that displays a static (not pulled from any sort of datasource) list of menu items like so:
<telerik:RadMenu ID="RadMenu1" runat="server" EnableShadows="true">
    <Items>
        <telerik:RadMenuItem Text="" PostBack="false" ImageUrl="~/i/opendata.png" NavigateUrl="data.aspx">
            <Items>
                <telerik:RadMenuItem Width="400px">
                    <ItemTemplate>
                        <div id="CatWrapper" class="Wrapper" style="width: 380px;">
                            <h3> Our Data</h3>
                            <table>
                                <tr>
                                    <td valign="bottom"><a href="dfaq.aspx"><img src="i/faq_24.png" alt="FAQ" /></a>
                                    </td>
                                    <td width="175px"><a href="dfaq.aspx">Data FAQ</a></td>
                                    <td valign="bottom"><a href="maps.aspx"><img src="i/map_24.png" alt="Maps" /></a></td>
                                    <td><a href="mapcat.aspx">Maps</a></td>
                                </tr>
                                <tr>
                                    <td valign="bottom" align="right"><a href="dldsoptions.aspx"><img src="i/globe_download_24.png" alt="Dowload Datasets" /></a>
                                    </td>
                                    <td><a href="dldsoptions.aspx">Download Datasets</a></td>
                                    <td valign="bottom"><a href="otherdata.aspx"><img src="i/link_24.png" alt="Other Data Links" /></a>
                                    </td>
                                    <td><a href="otherdata.aspx">Other Data Links</a></td>
                                </tr>
                                <tr id="sde">
                                    <td valign="bottom" id="sdeimgcell" runat="server" visible="false"><a href="sde.aspx"><img src="i/_engine_24.png" alt="SDE" /></a></td>
                                    <td id="sdelinkcell" runat="server" visible="false"><a href="sde.aspx" >Access Data</a></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                            </table>
                        </div>
                    </ItemTemplate>
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>

The last item I have set to visible="false" because I want to ensure in the code-behind that the user SHOULD see it, based on a role.  I can't for the life of me figure out how to "find" the <td id="sdelinkcell"...>!  Anyone?  I need to make it visible for one role, but I'm stumped!

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 26 Oct 2011, 12:10 PM
Hi Terri-Lynn,

You can find the table data on the client-side using jQuery as explained in these forums:
http://stackoverflow.com/questions/376081/how-to-get-a-table-cell-value-using-jquery
http://stackoverflow.com/questions/640903/jquery-how-can-i-find-if-an-id-has-a-specific-string

Please take a look the attached runnable page. You should also note that when you place any control in a template its Id changes therefore if you need to directly find the desired table data you will need to use the newly rendered Id (as explained in my comments).

Greetings,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Menu
Asked by
Terri-Lynn
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or