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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:11:34+00:00 2026-05-11T06:11:34+00:00

Is it possible to have a bound DataGridCheckBoxColumn call a method of click? Or

  • 0

Is it possible to have a bound DataGridCheckBoxColumn call a method of click? Or event a row level or row enter event?

I’m trying to implement a datagrid that updates the underlying filtered ObservableCollection collection (great sameple here http://petermcg.wordpress.com/2009/01/29/filtering-silverlight-datagrid-rows/)

The filtering works fine if I press an update button or another outside method. But, I can’t seem to find any internal grid event or anything on the DataGridCheckBoxColumn that will allow for me to call the update filter logic.

Any suggestions on how to implement a datagrid that updates the underlying collection on press of a checkbox?

Please find below my Xaml, it really isn’t anything special.

  • 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. 2026-05-11T06:11:34+00:00Added an answer on May 11, 2026 at 6:11 am

    The DataGridCheckBoxColumn Type does not currently provide a Click event, in fact it doesn’t currently provide any events. A cell rendered in a column of this Type just implements a TwoWay binding between the IsChecked property of a CheckBox control and the property (specified in the Binding) on the instance of T in the current row of the ObservableCollection<T> that the DataGrid is bound to.

    You don’t provide your Xaml so I’ll use the example from my blog post referenced in your question. The workaround involves specifying a DataGridTemplateColumn containing a CheckBox and defining the Click event as follows:

    <data:DataGrid x:Name='FilteredPeople' AutoGenerateColumns='False'>   <data:DataGrid.Columns>     <data:DataGridTextColumn Header='First Name' Binding='{Binding FirstName}' />     <data:DataGridTextColumn Header='Age' Binding='{Binding Age}' />     <data:DataGridCheckBoxColumn Header='Visible' Binding='{Binding IsVisible}' />      <data:DataGridTemplateColumn Header='Row Filter'>       <data:DataGridTemplateColumn.CellTemplate>         <DataTemplate>           <CheckBox x:Name='RowFilterButton' IsChecked='{Binding IsVisible}'                 Content='Filter' Tag='{Binding}' Click='RowFilterButton_Click' />         </DataTemplate>       </data:DataGridTemplateColumn.CellTemplate>     </data:DataGridTemplateColumn>    </data:DataGrid.Columns> </data:DataGrid> 

    An alternative to a CheckBox in this case could be a ToggleButton or normal Button control. Notice the binding for the Tag property of the CheckBox. This helps to find out in which row the CheckBox was clicked from code-behind:

    private void RowFilterButton_Click(object sender, RoutedEventArgs e) {     Person person = ((CheckBox)sender).Tag as Person; } 

    You can then remove this person from the ObservableCollection<T> or change it’s properties to filter or update the DataGrid as appropriate.

    That’s normally where this answer would end but if you do not have this update installed there is a bug in the default SDK version of the Silverlight 2 DataGrid that prevents this. In this case the bug will manifest itself by the DataGrid not drawing the row the CheckBox is in (instead what you get looks like an invisible row) if you cause the DataGrid to be filtered when you click that CheckBox (i.e. the Checkbox has focus).

    To avoid this bug, install the update or initiate any manipulation of the ObservableCollection<T> the DataGrid is bound to from a Control outside the DataGrid’s rows as per this example.

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

Sidebar

Related Questions

I have a click function bound to many elements. It is possible that sometimes
I have some elements with a function bound to the click event. I want
Is it possible to have the controls on a canvas be bound to a
Is it possible to have a free iPhone app that has say an initial
I have an input form that is bound to a model. The model has
If you have a DataGridView that is bound to a DataView (someDataTable.DefaultView). ..and a
I have my Html Textboxes created so that they will be bound to a
I have a simple video html5 tag, bound to an ended event: $('#video').show().trigger(play).bind('ended', function
i'm creating a shopping website. i have a gridview that is bound to an
Is it possible to use a wild card or call a method to work

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.