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

[Solved] Tooltip for textbox in Telerik Grid

3 Answers 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Madzie
Top achievements
Rank 1
Madzie asked on 18 Feb 2013, 06:54 PM
How can I associate a Tooltip to the <input type='text'> control ? which is a template.
This tooltip should be on the cell i.e. the Quantity column cell.
...
columns.Bound(r => r.Quantity).Title(
"Quantity").ToUpperInvariant() 

.ClientTemplate(
"<#if(PrdId < 0){#>" +

 "<input type='text' size='3' maxlength='10' value='<#= Quantity #>'/>"

+ "<# } else {#>" + "<div> <#= UnitQty #></div>" + "<# } #>");

).DataBinding(dataBinding => dataBinding.Ajax().Select("Method", "MyController"))

.TableHtmlAttributes(new { clientid = "myGrid" })

.ClientEvents(events => events.OnRowDataBound("MyDataRowDataBound"))

)

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 21 Feb 2013, 10:49 AM
Hello Varsha,

Basically you can use the title attribute added to the cell via the HtmlAttributes method. The title itself can contain client expression which are used in the templates.
e.g.

columns.Bound(c => c.FirstName).HtmlAttributes(new { title = "#= FullName#" });


Kind Regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Madzie
Top achievements
Rank 1
answered on 22 Feb 2013, 06:20 AM
Thanks Petur, but my intention was to have tooltip only for the <inputy type='text'> control since the clienttemplate,defines differently based on condition. As I updated, if PrdId < 0, then it will be a Textbox field else it is just a text displaying UnitQty.

I am looking for something, that will tooltip only for the textbox, and displays in tooltip a property value - say - <#= ErrorTooltip #>
Thanks.
0
Petur Subev
Telerik team
answered on 26 Feb 2013, 01:25 PM
Hello Varsha,

I am not sure I understand the problem basically you can add it to the input the same way:

.ClientTemplate(
"<#if(PrdId < 0){#>" +
 "<input type='text' size='3' maxlength='10' value='<#= Quantity #>' title='<#= ErrorTooltip #>' />"
+ "<# } else {#>" + "<div> <#= UnitQty #></div>" + "<# } #>");


Regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
Grid
Asked by
Madzie
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Madzie
Top achievements
Rank 1
Share this question
or