How to customize or disable tooltip on groups

I have custom CaptionTemplate for GridGroupSettings but the tooltip stays default. I tried to add SfTooltip, but the default tooltip is overlaping.


My code example:

<GridGroupSettings>
<CaptionTemplate>
@{
var order = (context as CaptionTemplateContext);
if (order.Field == nameof(Tender.State))
{
Models.Tender.TenderState state = (Models.Tender.TenderState) Enum.Parse(typeof(Models.Tender.TenderState), order.Key);
<SfTooltip Target="#txt">
<TooltipTemplates>
<Content>
@TenderStateToString(state, loc)
</Content>
</TooltipTemplates>
<span id="txt">
@FormatTenderState(state, loc)
</span>
</SfTooltip>
}
else
{
<label>@($"{order.HeaderText}: {order.Key} - {order.Count} {(order.Count > 1 ? sfLoc["Grid_Items"] : sfLoc["Grid_Item"])}")</label>
}
}
</CaptionTemplate>
</GridGroupSettings>

3 Replies

RS Renjith Singh Rajendran Syncfusion Team January 12, 2022 09:07 AM UTC

Hi David, 
 
Greetings from Syncfusion support. 
 
We have analyzed the shared codes, we suggest you to set empty title attribute for the div element enclosing the custom caption template content to disable the default tooltip shown in group caption. Please refer and use as like the code below, 
 
 
        <CaptionTemplate> 
            @{ 
                var order = (context as CaptionTemplateContext); 
                <SfTooltip Target="#txt"> 
                    <TooltipTemplates> 
                        <Content> 
                            <div>Custom tooltip</div> 
                        </Content> 
                    </TooltipTemplates> 
                    <span id="txt"> 
                        <div title=""> 
                             @order.Field - @order.Key 
                        </div> 
                    </span> 
                </SfTooltip> 
            } 
        </CaptionTemplate> 
 
 
Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 



DE David Eisler replied to Renjith Singh Rajendran January 20, 2022 08:23 AM UTC

Yes, that solve my problem.

Thank you

David E.



VN Vignesh Natarajan Syncfusion Team January 21, 2022 03:47 AM UTC

Hi David,  

Thanks for the update.  

We are glad to hear that you have resolved your query using our solution.  

Kindly get back to us if you have further queries.  

Regards, 
Vignesh Natarajan   


Loader.
Up arrow icon