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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:14:51+00:00 2026-05-16T22:14:51+00:00

When i use DataGridComboBoxColumn in my WPF DataGrid, the DataGrid SelectionChanged event is triggering

  • 0

When i use DataGridComboBoxColumn in my WPF DataGrid, the DataGrid SelectionChanged event is triggering multiple times based on the number of rows while loading the rows in the WPF DataGrid.

How can i stop this? Because of this I am facing Performance issue.

  • 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-16T22:14:51+00:00Added an answer on May 16, 2026 at 10:14 pm

    It depends on exactly how you have your bindings set up.

    If for instance you have an ObservableCollection and you add items to it when you load data, you might run into this kind of problem. There are multiple solutions but I’d rather pinpoint the problem than typing kilometers of text, so if you can provide a bit more details I’ll reply with my best guess at a solution.

    Edit: After seeing the sample I figured out what the problem is: there’s a DataGridComboBoxColumn in the DataGrid, with a SelectedValue binding to a property; when the binding is executed, the SelectionChanged event of the ComboBox is fired, and is caught by the handler on the DataGrid. There are several options to prevent this… one is to check the OriginalSource in the EventHandler, and the other is to handle the event on the ComboBox and to set its Handled property to true so it doesn’t get caught by the DataGrid handler as well.

    An alternative, much better solution would be to not handle the selection events in the code-behind unless there’s a very solid reason. It’s best to bind the ItemsSource of the DataGrid to an ICollectionView (ListCollectionView for example) which represents the original collection; the ICollectionView’s CurrentItem is automatically synchronized with the selected row in the DataGrid and you can handle selection changed events on the ICollectionView, making it much easier (and unit-testable, somewhat separate from the UI implementation etc.). This doesn’t work with multiple selections, but if you can only select a single row at a time it should work quite well.

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

Sidebar

Related Questions

I'm trying to use WPFToolkit's DataGrid control (and C#/.Net 3.5) to display a ComboBox
use pthread_create to create limited number of threads running concurrently Successfully compile and run
use grep command to find txt files containing telephone number. telephone number format could
Use trap to capture signals like this: i=-1;while((++i<33)); do trap echo $i >> log.txt
use strict; use warnings; open(FILE4,cool.txt); open(FILE6,>./mool.txt); $line = <FILE4>; while ($line ne ) {
Use OPENXML to get dt element in MSSQL 2005. How can I get xmlns:dt
use level1\level2\level3; Can someone explain with a simple demo ?
use I can't divide into segads. As for my above example if 5 threads
Use Case Show a photo uploaded by the user in a square box with
use C#,want to upload excel file on google doc. bellow syntax use to upload

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.