Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
755
Header tooltip
posted

I think you forgot to add a tooltip property to the column header.

I have tried to do the following:

 

column.Header.Text = string.Format("<span title=\"{0}\">{1}</span>", toolTip, column.Header.Text);

This works. I get a tooltip when I hover over the grid header. This solution has two disadvantages:

  1. Sorting does not work anymore; and
  2. the unnecessary overhead of a HTML SPAN tag 

Can you add a tooltip property? In the meantime do you have a better solution?
Roland

 

Parents
  • 33839
    Verified Answer
    posted

    Hey Roland,

    One solution would be to attach to the grid inititalize client event and set the title attribute of the columns' header elements.  I tried the following code and sorting still works.  The title attributes stay after sorting and a postback as well.  As for the tooltip property, I'd suggest submitting a feature request on that.

    function initGrid(grid, args) {
              var cols = grid.get_columns();
              var count = cols.get_length();
              for (var x = 0; x < count; ++x) {
                  var col = cols.get_column(x);
                  var el = col.get_headerElement();
                  el.title = col.get_headerText();
              }
          }

    <ig:WebDataGrid ID="WebDataGrid1" runat="server" >
                <ClientEvents Initialize="initGrid" />

     

    regards,

    David Young

     

Reply Children