Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3226470
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:27:38+00:00 2026-05-17T16:27:38+00:00

Hello First sorry for my english. I have started recently my first project on

  • 0

Hello
First sorry for my english.
I have started recently my first project on wpf. I´m styling a custom DataGrid who have been defined programatically (the xaml code doesn´t exists).
I have styled all that i need in my datagrid control except a checkbox that i wrapped inside.
The problem is that in other place of my application i defined a checkbox style how are applying correctly but i can´t apply inside my datagrid.
Actually my datagrid doesn´t throw syntax errors but when the datagrid runs the checkbox styles doesn´t apply.
The style code look like this (its defined in a stylesheet)

... <Setter Property="DataGridCheckBoxColumn.ElementStyle">
        <Setter.Value>
            <Style TargetType="{x:Type CheckBox}">

                <Setter Property="Background" Value="Yellow"/>
                <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type CheckBox}">


                            <BulletDecorator Background="Transparent">
                                <BulletDecorator.Bullet>
                                    <Grid Width="13" Height="13">
                                        <Border x:Name="Border" Background="Pink" BorderBrush="Black" BorderThickness="1,1,1,1" CornerRadius="2,2,2,2"/>
                                        <Path x:Name="CheckMark" Stroke="Green" StrokeThickness="2" SnapsToDevicePixels="False" Data="M1.5000001,1.5833334 L9.7920001,9.6666667 M1.5420001,9.6666667 L9.7083333,1.5000001" Margin="1" ClipToBounds="False" StrokeEndLineCap="Round" StrokeStartLineCap="Round"/>
                                    </Grid>
                                </BulletDecorator.Bullet>
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
                            </BulletDecorator>

                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Setter.Value>

    </Setter>...

Its exactly the same that it`s applying in the apliccation.
I´ve read a lot about it but i can´t to apply it, i tried, also, setting the setter property to “DatagridBoundColum.ElementStyle” and also to “CellStyle” but it doesn´t work.
Any suggest??
Thank a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:27:38+00:00Added an answer on May 17, 2026 at 4:27 pm

    Do it like you would do in xaml:

    <UserControl.Resources>
        <DataTemplate x:Key="CheckBoxTemplate">
            <CheckBox Style="{StaticResource AnyResourceKeyInApplciation}"/>
        </DataTemplate>
    </UserControl.Resources>
    <DataGrid x:Name="dataGrid" />
    
    this.dataGrid.Columns.Add(new DataGridTemplateColumn
                                  {
                                      CellTemplate = this.Resources["CheckBoxTemplate"] as DataTemplate
                                  }
                             );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first of all sorry by my bad english, Hello i am new in this
Hello and sorry for my bad english! I have a table like this: <table
First of all hello people, and sorry for my bad English, I'm Brazillian! I've
I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:
Hello this is may first question and I have found so far the following
First : Appologize for my bad english. Sorry for this newbie software question, but
first,sorry for my bad English!! i'm new here and i'm a beginner of android
hello dear developers. first of all - sorry for being the newbie.. i am
Hello fellow developers! Recently I've been playing with Rails 3.0 and after quite a
I have written my first Hello World Objective C program. How do I add

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.