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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:10:55+00:00 2026-05-22T20:10:55+00:00

I have a DataGrid and I want to populate a column that contains a

  • 0

I have a DataGrid and I want to populate a column that contains a ComboBox with a dynamic ItemsSource of elements, based on the row. I have the combo box display correctly, and the correct list of elements are populated in the list, as pulled in from the AvailableLogFileProcessTypes property, which is a ReadOnlyCollection. However, when the selection is made by the user in the combobox, the LogFileProcessType property is not set to the selection.

Data:

Property LogFileDirectories, IEnumerable<LogFileData>,
LogFileData:
public LogFileProcessType LogFileProcessType{get;set;}
public ReadOnlyCollection<LogFileProcessType> AvailableLogFileProcessTypes { get; set; }

The property currently has a backing field, and the breakpoint in the set property does not get hit, so I know it is localized to the binding setup. What is wrong with my XAML that is preventing the property from being set?

As you can see, I’ve tried setting both the SelectedValue and SelectedItem in the CellEditingTemplate and the CellTemplate. I am not sure which of these is appropriate.

 <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding Path=LogFileDirectories, UpdateSourceTrigger=PropertyChanged}"
      HeadersVisibility="Column" CanUserReorderColumns="False" CanUserAddRows="False" Margin="0,0,0,35" Grid.RowSpan="3">
<DataGrid.Columns>
    <DataGridCheckBoxColumn Header="Processed" Binding="{Binding Path=IsProcessingComplete, Mode=OneWay}" Width="70" IsReadOnly="True" />
    <DataGridTemplateColumn Header="template">
        <DataGridTemplateColumn.CellEditingTemplate>
            <DataTemplate>
                <ComboBox SelectedValue="{Binding Path=LogFileProcessType, Mode=TwoWay}"
                          SelectedItem="{Binding Path=LogFileProcessType, Mode=TwoWay}"
                          ItemsSource="{Binding Path=AvailableLogFileProcessTypes}"/>
            </DataTemplate>
        </DataGridTemplateColumn.CellEditingTemplate>      
        <DataGridTemplateColumn.CellTemplate>
            <DataTemplate>
                <ComboBox SelectedValue="{Binding Path=LogFileProcessType, Mode=TwoWay}"
                          SelectedItem="{Binding Path=LogFileProcessType, Mode=TwoWay}"
                          ItemsSource="{Binding Path=AvailableLogFileProcessTypes}"/>
            </DataTemplate>
        </DataGridTemplateColumn.CellTemplate>                            
    </DataGridTemplateColumn>                        
</DataGrid.Columns>                    
</DataGrid>
  • 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-22T20:10:56+00:00Added an answer on May 22, 2026 at 8:10 pm

    See Damascus response for thought process.

    Need to Specify UpdateSourceTrigger on CellTemplate / CelLEditTemplate. This triggers the property change.

     <DataGridTemplateColumn Header="template">
        <DataGridTemplateColumn.CellEditingTemplate>
            <DataTemplate>
                <ComboBox SelectedValue="{Binding Path=LogFileProcessType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                          ItemsSource="{Binding Path=AvailableLogFileProcessTypes}"/>
            </DataTemplate>
        </DataGridTemplateColumn.CellEditingTemplate>      
        <DataGridTemplateColumn.CellTemplate>
            <DataTemplate>
                <ComboBox SelectedValue="{Binding Path=LogFileProcessType, UpdateSourceTrigger=PropertyChanged}"
                          ItemsSource="{Binding Path=AvailableLogFileProcessTypes}"/>
            </DataTemplate>
        </DataGridTemplateColumn.CellTemplate>                            
    </DataGridTemplateColumn>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a datagrid that I want to filter based on a value selected
I have a datagrid with 2 DataGridComboxClolumn elements and want to change the ItemsSource
I have the following scenario, I want to create a DataGrid and then populate
I have a datagrid that I want to add a button/s to at runtime.
I have a dojox.grid.DataGrid where I want to select a row programmatically. I'm using
I have a DataGrid which has a DataGridTemplateColumn that uses the ItemsSource binding of
I have a DataGrid that I have bound to a property: <cd:DataGrid Name=myDataGrid ItemsSource={Binding
I have a DataGrid that two of its columns are ComboBoxes (one contains few
I have a datagrid in which i have combobox in a column. On a
I have Datagrid which is bound to my Database <WpfToolkit:DataGrid Name=DataGrid1 Grid.Row=1 ItemsSource={Binding Path=MainSearchBinding}

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.