RadToolTip for mulitple datakeyname

5 posts, 1 answers
  1. SoniTek
    SoniTek avatar
    43 posts
    Member since:
    Apr 2005

    Posted 10 Nov 2012 Link to this post

    Hello,

    This line work for a single DataKeyNames

    RadToolTipManager1.TargetControls.Add(gridItem(column.UniqueName).ClientID, (TryCast(e.Item, GridDataItem)).GetDataKeyValue("MasterNum").ToString(), True)

    Is there away to code this for multiple DataKeyNames eg.

     

    DataKeyNames("MasterNum,LodgeNum")

     

     

     

     

     

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 13 Nov 2012 Link to this post

    Hi,

    This functionality is part of the RadGrid and not of the RadTooltip. It is controlled by the DataKeyNames property of the MasterTableView of RadGrid. You can see it in action in this online demo with the tooltip manager. You can simply add more key names there.

    What I can also suggest is using the approach from this demo to get the data from more columns: http://demos.telerik.com/aspnet-ajax/tooltip/examples/databasetooltipswithoutlod/defaultcs.aspx.


    Greetings,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. SoniTek
    SoniTek avatar
    43 posts
    Member since:
    Apr 2005

    Posted 13 Nov 2012 Link to this post

    Hello Marin,

    Thank you for the quick reply and the examples does help understanding however, I need the tooltip control to query the database for the combination of two fields.

    Thanks,
  5. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 14 Nov 2012 Link to this post

    Hello,

    The tooltip only takes a string for its value. How the string is created is the developer's decision and task. You can query your database wit your code and return a value to pass to the tooltip.

    In case you want to have the tooltip load content based on both keys - you can concatenate the strings with a special character inbetween (e.g. a | symbol) and in the OnAjaxUpdate event the tooltip manager offers you can split the Value that is passed, get your keys and query your database again. See this demo for another example of this logic.


    Greetings,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. SoniTek
    SoniTek avatar
    43 posts
    Member since:
    Apr 2005

    Posted 15 Nov 2012 Link to this post

    Thanks Marin.

    It is working now. Did exactly what you have mentioned.

    1. Concatenate the 2 values for the tooltip targetcontrol
    2. Split the values OnAjaxUpdate and query the database filter by the two values.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017