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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:53:05+00:00 2026-06-12T07:53:05+00:00

If I define a Combobox within a DataGridTemplateColumn as below then there will be

  • 0

If I define a Combobox within a DataGridTemplateColumn as below then there will be multiple Comboboxes for each new row added

<DataGridTemplateColumn x:Name="DataGridTempCol" Header="Items">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <ComboBox x:Name="combo" DisplayMemberPath="Value" SelectedValuePath="Key"   ItemsSource="{Binding comboBoxSelections, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" SelectionChanged="combo_SelectionChanged" >
            </ComboBox>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

I now want to add SelectionChanged event for every Combox. I’ve tried the following

private void combo_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    // Every SelectedItem is one data object in Dictionary collection.
    KeyValuePair<string, string> selob =
        (KeyValuePair<string, string>)combo.SelectedItem;
    string selKey = selob.Key;
    string selvalue = selob.Value; 
}

but combo is not recognised as it isn’t a single instance of a ComboBox. How do I refer to the ComboBox that generated the event and access the SelectedItem?

  • 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-06-12T07:53:07+00:00Added an answer on June 12, 2026 at 7:53 am

    Have you tried the following? My first guess is that this should either give you the ComboBox or the entire DataGrid.

    e.OriginalSource
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using ExtJs4 and I'm trying to extend the Ext.form.field.ComboBox like below: Ext.define('GenericCombo', {
Below is the combo code: Ext.define('Grade', { extend: 'Ext.data.Model', fields: [ { name: 'id',
Currently I have a ComboBox defined as: <ComboBox Name=comboItems ItemsSource={Binding Path=EnumDataItems} DisplayMemberPath=Description ToolTip={Binding Path=ToolTip}
I create a combobox in Extjs where i am showing name of Reports and
I have been trying to define multiple combo boxes in R using the tcltk
Hi I try set default value for comboBox. XAML: <ComboBox Name=StatusCombo Style={StaticResource statusComboStyle} SelectedValuePath=StatusMsg
How can I get a WPF ComboBox that is within a DataTemplate within an
I have 10 ComboBox controls that will use the same item template (an Image
I want to fill items in a combobox, each of them has different behaviour.
I'm using multiple ObjectDataSources to fill ComboBox-fields in a FormView. The FormView is sort

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.