Custom Style GeneralCellType

Posted by: quockhanhk15tpm on 23 June 2022, 2:41 pm EST

    • Post Options:
    • Link

    Posted 23 June 2022, 2:41 pm EST - Updated 3 October 2022, 11:28 pm EST


    I using GcSpreadGrid.

    How can custom cell like in the attached image?


  • Posted 23 June 2022, 6:18 pm EST


    Thanks for the snapshot.

    You can achieve this requirement by setting CellType on a particular column as DataTemplateCellType:

    	 DataTemplateCellType dtCellType = new DataTemplateCellType();
                spread.Columns[2].CellType = dtCellType;
                dtCellType.DisplayElementTemplate= this.Resources["dtCellTemplate"] as DataTemplate;

    You can add UIElements in DisplayElementTemplate and style them accordingly:

            <DataTemplate x:Key="dtCellTemplate">
                <Border CornerRadius="8" BorderThickness="3" BorderBrush="Blue" Margin="0">
                        <TextBlock Text="{Binding Value}" Width="100" TextAlignment="Center" Foreground="Blue"/>

    Please refer the attached sample for the same :

    JFYI, Grapecity Forums are categorized by Product and Platform. You are posting queries in ComponetOne Wpf-Edition. We request you to please post your queries in Spread for WPF/Silverlight if your query is related to Spread Wpf. Refer here for the Spread Wpf/Silverlight Forum Topics :

    Please make sure next time that you are posting your queries to related Forum Topics.

    Best Regards,


  • Posted 23 June 2022, 7:05 pm EST


    Thanks for you answer.

    It’s great.

    I know.

    Next time I will pay attention

    Best Regards,

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels