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
close icon

Foreground (text) color using styling

I am trying to change the color of the text in the SfDataGrid.
I have tried setting the Foreground color for the entire grid using Visual Studio's Properties panel as well as using a RowStyle and CellStyle however the font refuses to change color and always remains black.
I have managed to change the border and background colors as well as the font type and size but the color refuses to change.

Any ideas?

1 Reply

JG Jai Ganesh S Syncfusion Team August 26, 2015 02:17 PM UTC

Hi Ralph,


Thank you for contacting Syncfusion Support.


We have analyzed your query. You can achieve your requirement for changing the text color of SfDataGrid by writing the style for SfDataGrid and set the ForeGround color.


Code Snippet [XAML]:

<Window.Resources>

       

        <Style TargetType="syncfusion:SfDataGrid">

            <Setter Property="Foreground" Value="Red"/>

        </Style>

    </Window.Resources>


We have also prepared the sample based on this and please find the sample from the below location,


Sample: http://www.syncfusion.com/downloads/support/directtrac/143174/ze/WpfTestingSample-173558743


UG Link: http://help.syncfusion.com/ug/wpf/index.html#!Documents/createasimpleapplicationwithdatagrid.htm


Please let us know if you need further assistance.


Thank you,

Jai Ganesh S


Loader.
Live Chat Icon For mobile
Up arrow icon