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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change background color of the very first column

Thread ID:

Created:

Updated:

Platform:

Replies:

117593 Nov 13,2014 08:53 AM UTC Nov 13,2014 02:12 PM UTC WinRT 1
loading
Tags: SfDataGrid
Vladimir
Asked On November 13, 2014 08:53 AM UTC

Hi there,

How can I change background color of the "tool" column?
I've already tried:
  <Style x:Key="headerCellStyle" TargetType="syncfusiongrid:GridHeaderCellControl">
            <Setter Property="Background" Value="DarkRed" />
        </Style>

all columns get filled with DarkRed color except the first one. (see attachment)

thanks in advance.




Attachment: 1_c188b289.zip

Farjana Parveen Ayubb [Syncfusion]
Replied On November 13, 2014 02:12 PM UTC

Hi Vladimir,

Thank you for contacting Syncfusion support.

We have analyzed your query. If you set the HeaderStyle property in grid, style will be applied for all the column headers in the grid. So if you want to set the style for particular column only, you can use the HeaderStyle property in the GridColumn. And if you need to set the style for particular column, you can use the CellStyle property in grid column.

Please refer the below code snippet and sample in the following location:

Code Snippet:

Please refer the below code snippet for styling the HeaderCell and GridCell

<Page.Resources>

        <Style x:Key="headerstyle" TargetType="syncfusion:GridHeaderCellControl">

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

        </Style>

        <Style x:Key="cellstyle" TargetType="syncfusion:GridCell">

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

        </Style>

    </Page.Resources>

 

Please refer the below code snippet for setting the style to the particular column.

    <syncfusion:SfDataGrid.Columns>

                    <syncfusion:GridTextColumn MappingName="ProductId" CellStyle="{StaticResource cellstyle}" HeaderStyle="{StaticResource headerstyle}"/>

                    <syncfusion:GridTextColumn MappingName="ProductName"/>

                </syncfusion:SfDataGrid.Columns>

 

UG Link: http://help.syncfusion.com/UG/winrt/default.htm#!Documents/stylingcells.htm


Regards,

Farjana Parveen A


Attachment: SfDataGrid_Changing_Background_color_fa25e1c7.zip

CONFIRMATION

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.

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

;