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

Grid header Tooltips in MVC

3 Answers 1106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 2
Ian asked on 12 Jul 2013, 04:49 PM
I have a simple Grid bound to a Model. Works nice. I need to place tool tips, different for each column header, on the grid. I don't see an MVC object to do that though?

@(Html.Kendo().Grid(Model.Items as IEnumerable<Holding>)
                               .Name("KendoCGrid")
                               .Columns(columns =>
                                   {
                                       columns.Bound(e => e.SymbolDescription).Title("Security Name");
                                       columns.Bound(e => e.Symbol).Title("Symbol");
                                       columns.Bound(e => e.SecurityType).Title("Type");
                                   })
                                   .Sortable()
                                   .DataSource(dataSource=>dataSource
                                      .Ajax()
                                      .PageSize(50)
                                      .ServerOperation(false)
                                   )
                                    
                                   

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 16 Jul 2013, 09:00 AM
Hello Ian,

You can use:

1. the title HTML attribute in HeaderHtmlAttributes() for each column

or

2. separate Kendo UI Tooltips targeted at the Grid header cells. Note that you will still need to apply title attributes to the header cells.


Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ian
Top achievements
Rank 2
answered on 18 Jul 2013, 09:15 PM
(We can't use the ToolTip by Kendo due to designer requirements and must use the one provided by the Browser)

The first solution only works if the Sortable() setting is on. When its not, there isn't an <a> element created that has a title visible to a user when they mouse-hover.

Here's the HTML it renders notice that the title attribute only goes on the <th> so does not appear as a tool tip:
<th class="k-header" data-field="Client" data-title="Acct. Name / Num" scope="col" title="This is my tooltip text.">
       
       <span class="k-link">Acct. Name / Num</span>
</th>
0
Accepted
Dimo
Telerik team
answered on 19 Jul 2013, 05:23 AM
Hello Ian,

A title attribute applied to the Grid header cell will work regardless of the Sortable() setting:

http://screencast.com/t/XWkXV3iLQr

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Ian
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Ian
Top achievements
Rank 2
Share this question
or