Button Dynamic tooltip

Hi,


I saw the sample of adding a tooltip to a button here https://blazor.syncfusion.com/documentation/button/how-to/tooltip-for-button/ .


But what if I want to display the value of the tooltip in runtime, ie I need to call a method to get the tooltip value, just before it is shown?


1 Reply 1 reply marked as answer

GK Gayathri KarunaiAnandam Syncfusion Team July 8, 2021 03:47 AM UTC

Hi SSG, 

We have checked your reported query. We would like to let you know that we have OnOpen event for the Tooltip. This event is triggered before the tooltip is displayed over the target element. We have prepared a sample in which the tooltip content is changed. Please check the code snippet and sample. 

<SfTooltip  @ref="Tooltip" Target="#target" Content="@Content" OpensOn="Click" OnOpen="open"> 
    <SfButton ID="target" Content="Show Tooltip"></SfButton> 
</SfTooltip> 
 
@code 
{ 
    SfTooltip Tooltip; 
    string Content="Tooltip with delay"; 
     
 
    public void open(TooltipEventArgs args) 
    { 
         Content = "Changed"; 
    } 
} 
 
 

For your reference, we have prepared a sample based on your requirement. Please check the below link. 


Please get back to us, if you need further assistance. 

Regard, 
Gayathri K 


Marked as answer
Loader.
Up arrow icon