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

  • Home
  • SEARCH
  • 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 5953069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:46:19+00:00 2026-05-22T17:46:19+00:00

I am using the silverlight 4 toolkit gridcontrol and I’m using auto generated columns.

  • 0

I am using the silverlight 4 toolkit gridcontrol and I’m using auto generated columns. My boolean field is showing up as a tri-state checkbox (true, false, null).

public bool? Enabled { get; set; }

How to I force it to use only two states (true/false). Changing the field type is not an option at this time.

@Bala

[XAML]

<sdk:DataGrid Grid.Row="1" Grid.Column="1" x:Name="liveGrid" 
HorizontalAlignment="Center"
VerticalScrollBarVisibility="Hidden"  HorizontalContentAlignment="Center"
ItemsSource="{Binding MyDatasource}" AutoGenerateColumns="True" />

Just a thought: does a UIHint data annotation exist for this, maybe?

Possible Solution

Following @Rick I have a working solution:

[XAML]

<sdk:DataGrid Grid.Row="1" Grid.Column="1" x:Name="liveGrid" 
HorizontalAlignment="Center"
VerticalScrollBarVisibility="Hidden"  HorizontalContentAlignment="Center"
AutoGeneratingColumn="viewModel_AutoGeneratingColumn" 
ItemsSource="{Binding MyDatasource}" AutoGenerateColumns="True" />

[View]

 private void viewModel_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)
    {
        if ("Enabled" == e.PropertyName)
        {
            DataGridCheckBoxColumn checkBox = e.Column as DataGridCheckBoxColumn;
            checkBox.IsThreeState = false;
        }
    }
  • 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-22T17:46:20+00:00Added an answer on May 22, 2026 at 5:46 pm

    You can continue to use auto-generated columns and customize those columns. Here is an article that describes how to customize auto-generated columns:

    • How to: Customize Auto-Generated Columns in the DataGrid Control

    The technique mainly consists of hooking the DataGrid.AutoGeneratingColumn event.

    If you follow that procedure, all you need to do is find your column (e.g. by property name) and set IsThreeState to false:

    • DataGridCheckBoxColumn.IsThreeState Property
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a complex project using SilverLight Toolkit's ListBoxDragDropTarget for drag-drop operations and it
I am using Silverlight 3.0 Unit Testing, version Silverlight Toolkit November 2009. Apart from
I've been using the Silverlight Toolkit but I'm finding the quality lacking; in particular
I'm working on some charting, and am currently using the Silverlight Toolkit. At the
I'm using the SilverLight Toolkit to implement some drag/drop functionality in a Silverlight 4
I'm using the AutoCompleteBox of the silverlight toolkit in my WP7 application. When the
Using the drag'n'drop features of the Silverlight 4 Toolkit, I have a drag'n'drop enabled
I am using the StackedColumnSeries from the Silverlight toolkit to display some data. I
I'm using the ContextMenu control from the Silverlight Toolkit, and I'd like to define
I'm using the NumericUpDown control from Silverlight Control Toolkit, that sometimes triger twice the

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.