radslider tooltips

2 posts, 0 answers
  1. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 31 Jul 2015 Link to this post

    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

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 04 Aug 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top