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

radslider tooltips

1 Answer 112 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Fit2Page asked on 31 Jul 2015, 08:31 AM

For a radslider with databoud items i want to tooltiptify with:

 

    Protected Sub statusslider_DataBound(sender As Object, e As System.EventArgs)

        Dim rs As RadSlider = CType(sender, RadSlider)

        For Each item As RadSliderItem In rs.Items
            RadToolTipManager1.TargetControls.Add(item.ClientID, "aa", True)
        Next
  

    End Sub​

 

But this ain't working. Also AutoTooltiptify with ZoneID is only working for the slider tooltip but not for the items tooltips.

Any idea how I could get this to work?

 

Marc

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 04 Aug 2015, 11:24 AM
Hi Marc,

The resolution for this case is the same as the one in your other forum post, about TooltipManager—http://www.telerik.com/forums/tooltipzoneid. The best solution is to manually handle the slider's client-side load event and tooltipify the items. 

Example:

ASP.NET 
<telerik:RadToolTipManager runat="server" ID="TTM1" AutoTooltipify="true" />
 
<telerik:RadSlider ID="slider" runat="server" Width="800"
    ItemType="Item" Height="100" AutoPostBack="true" OnClientLoad="OnClientLoad">
    <ItemBinding TextField="Name" ToolTipField="Description" ValueField="ID"></ItemBinding>
</telerik:RadSlider>
 
<script type="text/javascript">
    function OnClientLoad(sender, args) {
        var tooltipManager = $find("<%= TTM1.ClientID %>");
        tooltipManager.tooltipify(sender.get_element());
    }
</script>

C#
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack) {
        slider.DataSource = GetDataSource();
        slider.DataBind();
    }
}
 
private IEnumerable GetDataSource()
{
    List<object> dataSource = new List<object>();
 
    dataSource.Add(new { Name = "Name 1", Description = "Description 1", ID = "1" });
    dataSource.Add(new { Name = "Name 2", Description = "Description 2", ID = "2" });
    dataSource.Add(new { Name = "Name 3", Description = "Description 3", ID = "3" });
    dataSource.Add(new { Name = "Name 4", Description = "Description 4", ID = "4" });
    dataSource.Add(new { Name = "Name 5", Description = "Description 5", ID = "5" });
    dataSource.Add(new { Name = "Name 6", Description = "Description 6", ID = "6" });
    dataSource.Add(new { Name = "Name 7", Description = "Description 7", ID = "7" });
    dataSource.Add(new { Name = "Name 8", Description = "Description 8", ID = "8" });
    dataSource.Add(new { Name = "Name 9", Description = "Description 9", ID = "9" });
 
    return dataSource;
}


Regards,
Ianko
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ToolTip
Asked by
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Ianko
Telerik team
Share this question
or