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 6050831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:44:00+00:00 2026-05-23T07:44:00+00:00

I have discovered an odd behaviour when replacing a DataGridCheckBoxColumn against a DataGridTemplateColumn that

  • 0

I have discovered an odd behaviour when replacing a DataGridCheckBoxColumn against a DataGridTemplateColumn that contains a Checkbox.

 <sdk:DataGrid Grid.Column="0" IsReadOnly="{Binding IsInReadOnlyMode}">                                        
   <sdk:DataGrid.Columns>
     <sdk:DataGridCheckBoxColumn Header="Sales" Binding="{Binding Path=Sales}" />
   </sdk:DataGrid.Columns>
 </sdk:DataGrid>

When the DataGrid is readonly then the checkbox is also disabled. The code above works correct.

Now if I want to achieve the same thing by using DataGridTemplateColumn, the checkbox doesn’t seem to disable itself when the DataGrid is in ReadOnly mode.

<sdk:DataGrid Grid.Column="0" IsReadOnly="{Binding IsInReadOnlyMode}">                                        
   <sdk:DataGrid.Columns>
     <sdk:DataGridTemplateColumn Header="Sales" >
                            <sdk:DataGridTemplateColumn.CellEditingTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <CheckBox>
                                            <CheckBox.IsChecked>
                                                <Binding Path="Sales" Mode="TwoWay"/>
                                            </CheckBox.IsChecked>
                                        </CheckBox>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellEditingTemplate>
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <CheckBox>
                                            <CheckBox.IsChecked>
                                                <Binding Path="Sales" Mode="TwoWay"/>
                                            </CheckBox.IsChecked>
                                        </CheckBox>
                                    </Grid>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>
   </sdk:DataGrid.Columns>
 </sdk:DataGrid>

One other thing I noticed that might help to explain this is that the checkbox inside DataGridCheckBoxColumn is always disabled until you actually doubleclick the containing cell. Only then once in edit mode I can access the Checkbox.

In the CheckBox I created myself inside DataGridTemplateColumn, the checkbox seem always to be active and can be ticked on and off without even doubleclicking the cell first.

Btw I am using it in Silverlight4, but I am pretty sure it must be the same in WPF.

Can somebody explain to me why that is please?
Thanks,

  • 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-23T07:44:01+00:00Added an answer on May 23, 2026 at 7:44 am

    Regarding the double click in case of DataGridCheckBoxColumn and no click in case of DataGridTemplateColumn, I think this is happening because inside the DataGridCheckBoxColumn the CellTemplate and EditingCellTemplate would have been implemented differently. In case of CellTemplate it would be defined as readonly and once you double click you go in editing mode i.e. EditingCellTemplate and only then you can modify the checkbox and it makes sense.

    Now in your case as you have defined both the editing and non-editing template same, so the checkbox is always ready to accept the input

    Regarding your main question that why the checkbox in custom template mode is not following the GridReadOnly option, I think this is happening due to the fact that once you define cell templates yourself i.e. cellEditing template and non-editing celltemplate it becomes your responsibility to handle the read only behavior of cells. The option applied on the grid such as read only won’t have any effect in templatedcolumn case

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just discovered something that I found odd. I have mys listbox with several
I have discovered that MySQL is returning odd results when searching on INT columns.
I have discovered through trial and error that the MATLAB engine function is not
We have discovered that one of our auto generated assemblies is throwing a StackOverflowException
Recently I have discovered that my release executable (made with msvc++ express 2008) becomes
My testers have discovered that if you type free text into a file upload
While debugging an issue with our system, I have discovered a thread contention that
As well as my question Removing MKMapView Annotations causes leaks. I have discovered that
I have just discovered the nifty unhandled exception handler for cocoa-touch. Now that I
I have just discovered that if generating assemblies via Reflection.Emit, the .NET framework keeps

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.