We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cell style: set Underlined text

Thread ID:





141893 Jan 9,2019 04:48 PM UTC Jan 11,2019 10:15 AM UTC WPF 3
Tags: SfDataGrid
Sauro Rossi
Asked On January 9, 2019 04:48 PM UTC

Good evening,
Is possible to set a Underline FontStyle in a WPF SFDatagrid cell ?
I'm able to set FontWeight, FontStyle , ... but I'm not able find the Underline style. 

Thanks and Regards

<Syncfusion:GridTemplateColumn Width="75" MappingName="LapValueDataDrvList[0].LapValueData" TextAlignment="Right" >
 <Style TargetType="Syncfusion:GridCell">
                                <DataTrigger Binding="{Binding Path=ValueXYZ}" Value="1">
                                    <Setter Property="FontStyle" Value="Italic" />      <!-- this works fine -->
                                    <Setter Property="FontStyle" Value="Underline" />      <!-- It doesn't exist -->

Jayaleshwari N [Syncfusion]
Replied On January 10, 2019 12:11 PM UTC

Hi Sauro,  
Thanks for contacting Syncfusion Support.  
We have analyzed your query “Underline not work with CellStyle” from our side. You can able to set underline for GridColumns text by using GridColumn.TextDecoration property. But it will not work for GridTemplateColumn. And we have internally used the DisplayElement as a content control for GridTemplateColumn, and the cell template loaded content  is added as a child of the content control and it will be showing on the UI.   
You can achieve your requirement Underline text for TextBlock by using the below code snippets.  
<syncfusion:GridTemplateColumn HeaderText="Order ID TEMP" MappingName="OrderID">  
            <TextBlock Text="{Binding OrderID}" >  
                            <DataTrigger Binding="{Binding Path=OrderID}" Value="1000">  
                                <Setter Property="TextBlock.FontStyle" Value="Italic" />  
                                <Setter Property="TextBlock.TextDecorations" Value="Underline"/>  
We have attached the sample for your reference and you can download the same from the following location. 
you can refer the following user guide documentation for TextDecorations property 
Jayaleshwari N. 

Sauro Rossi
Replied On January 10, 2019 03:58 PM UTC

Hi Jayaleshwari,
Thanks for your answer. Suggested approach works perfectly in my scenario.


Jayaleshwari N [Syncfusion]
Replied On January 11, 2019 10:15 AM UTC

Hi Sauro, 
Thanks for the update. Please get in touch if you would require for further assistance. 
Jayaleshwari N. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon