Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > SiteMap > Site map : title attribute is not displayed on links

Not answered Site map : title attribute is not displayed on links

Feed from this thread
  • jocelyn payneau avatar

    Posted on Sep 5, 2010 (permalink)

    Hello,

    I don't manage to display the title attribute on links. Here is my html code:
    <telerik:RadSiteMap runat="server" ID="RadSiteMap1" DataSourceID="SqlDataSource1"
        DataFieldID="SiteMapId" OnNodeDataBound="RadSiteMap1_NodeDataBound"  
        DataFieldParentID="ParentID" DataNavigateUrlField="NavigateUrl" DataTextField="SiteMapTitle" ShowNodeLines="false" >
        <DataBindings>
            <telerik:RadSiteMapNodeBinding NavigateUrlField="NavigateUrl" />
        </DataBindings>
        <LevelSettings>
            <telerik:SiteMapLevelSetting Level="0">
                <ListLayout RepeatColumns="2" AlignRows="true" />
            </telerik:SiteMapLevelSetting>
        </LevelSettings>
    </telerik:RadSiteMap>
      
    <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>"
        SelectCommand="SELECT SiteMapId, ParentID, SiteMapTitle, NavigateUrl, SortOrder, SiteMapTitle as Tooltip FROM [SiteMap]">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="SiteMapId" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    and my server code:
    protected void RadSiteMap1_NodeDataBound(object sender, RadSiteMapNodeEventArgs e)
        {
            DataRowView nodeData = e.Node.DataItem as DataRowView;
            e.Node.Target = "_self";
      
            e.Node.ToolTip = nodeData["Tooltip"].ToString(); ;
        }

    Thanks for your answers

    Reply

  • Veronica Veronica admin's avatar

    Posted on Sep 6, 2010 (permalink)

    Hi jocelyn payneau,

    The problem is that you are trying to add an ALIAS to the SiteMapTitle in the SQL Select Statement. Try the following as an alternative to set the Tooltip equals the SiteMapTitle:

    Remove the alias from the SQL SelectCommand:
    <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>"
                SelectCommand="SELECT SiteMapId, ParentID, SiteMapTitle, NavigateUrl, SortOrder, SiteMapTitle as Tooltip FROM [SiteMap]">
                <SelectParameters>
                    <asp:Parameter DefaultValue="1" Name="SiteMapId" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>

    C#: 
    protected void RadSiteMap1_NodeDataBound(object sender, Telerik.Web.UI.RadSiteMapNodeEventArgs e)
        {
            DataRowView nodeData = e.Node.DataItem as DataRowView;
            e.Node.Target = "_self";
      
            e.Node.ToolTip = nodeData["Title"].ToString() + " "; 
        }
     
    Markup remains the same.

    Please let me know if this was helpful.

    Kind regards,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > SiteMap > Site map : title attribute is not displayed on links