RadGrid GridTemplateColumn sorting image tooltip

2 posts, 0 answers
  1. krishan kumar
    krishan kumar avatar
    1 posts
    Member since:
    May 2010

    Posted 10 May 2010 Link to this post

    Hi,
    i needs to be changed default RadGrid GridTemplateColumn sorting "ASC/DESC" image tooltip...

    please help me.....
  2. Radoslav
    Admin
    Radoslav avatar
    1566 posts

    Posted 11 May 2010 Link to this post

    Hello Krishan,

    To achieve the desired functionality you could try the following approach:
    On RadGrid.ItemDataBound event handler you could get the header item and find the ASC/DESC sorting button:
    void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
         if (e.Item is GridHeaderItem)
         {
             GridHeaderItem item = (GridHeaderItem)e.Item;
             if (item["TemplateColumn"].Controls.Count > 1)
             {
                 string clietnID = (item["TemplateColumn"].Controls[2] as Button).ClientID;
                 ScriptManager.RegisterStartupScript(Page, Page.GetType(), "toottip", "changeTooltip('" +clietnID + "');", true);
              }
         }
     }

    Then you could register startup script which changes the input's title attribute on the client:
    <telerik:RadCodeBlock runat="server" ID="RadCodeBlock">
            <script type="text/javascript">
                function changeTooltip(id)
                {
                    var img = document.getElementById(id);
                    img.title = "Test";
                }
            </script>
     </telerik:RadCodeBlock>

    Additionally I am sending you a simple example which demonstrates how to achieve the desired functionality.

    Greetings,
    Radoslav
    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.
Back to Top