Tool tips for header labels

Last post 01-20-2010 10:51 AM by sonu. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 01-19-2010 4:33 PM

    Tool tips for header labels

    Hi

    How can I attach custom tooltips to the header text when the user hovers his mouse on the text.

    I did look into this link from the other post but need to know how to attach onmouseover event to header text

    http://www.walterzorn.com/tooltip/tooltip_e.htm#download

    Any updates on V2.. your controls ROCK..

    Thanks

     

  •  Advertisement

    Featured Advertisement

     
  • 01-19-2010 8:10 PM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: Tool tips for header labels

    You should be able to use the ItemDataBound or RowDataBound event to get the header. Once you have the header you just need to set the onmouseover/out events. I will get an example tomorrow. I did not receive a lot of feedback for the controls, which is why I had temporarily stopped the development on the controls.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 01-19-2010 9:22 PM In reply to

    Re: Tool tips for header labels

    I was trying to do that.. will try again tomorrow.

    No I think ADC is very flexible and I use it every project. I already have used in 3 projects and all are Live. So please continue to develop it.

    Thanks

    Rakesh.

  • 01-20-2010 8:40 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: Tool tips for header labels

    Which control are you using?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 01-20-2010 9:11 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: Tool tips for header labels

    Here is how you would do it with the GridView:

    <AjaxData:GridView runat="server" ID="gridview1" RowDataBoundEvent="onRowDataBound">
        <Columns>
            <AjaxData:GridViewBoundColumn DataField="Id" HeaderText="Id" />
            <AjaxData:GridViewBoundColumn DataField="Username" HeaderText="Username" />
        </Columns>
    </AjaxData:GridView>


    function onRowDataBound(sender, e)
    {
        if (e.get_row().get_rowType() == AjaxDataControls.GridViewRowType.Header)
        {
            var row = e.get_row();
            var item = row.get_dataItem();

            var idIndex = gridview1.getColumnIndexByHeaderText('Id');
            var tdId = row.get_container().childNodes[idIndex];
            tdId.onmouseover = function() { this.style.backgroundColor = 'red' }; // Replace this with the js function for the tooltip
            tdId.onmouseout = function() { this.style.backgroundColor = '' };
        }
    }

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 01-20-2010 9:40 AM In reply to

    Re: Tool tips for header labels

    Mostly the GridView sometimes the Repeater

    Thanks

    Rakesh

  • 01-20-2010 10:46 AM In reply to

    Re: Tool tips for header labels

    Thanks, this worked great with the JS library for tool tips.

    Rakesh

  • 01-20-2010 10:51 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: Tool tips for header labels

    Great to see that it works. Please feel free to submit more feedback about the controls, so that we can improve the controls.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
Page 1 of 1 (8 items)