how to update a column of DataGrid when another column is changed on the same row

wpf

Solution

Do all your manipulation in the ViewModel. Create a property to Bind combo box's selectedItem, you can bind to that property in the next column.

<DataGrid ItemsSource="{Binding ViewModel.Rows}" >
    <DataGrid.Columns>
        <DataGridTemplateColumn>
            <DataGridTemplateColumn.CellTemplate>
                <DataTemplate>
                    <ComboBox ItemsSource="{Binding ViewModel.ComboBoxItems}" SelectedItem="{Binding ViewModel.ComboBoxSelectedItem}"/>
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>

        <DataGridTextColumn Binding="{Binding ViewModel.ComboBoxSelectedItem.Name}" />

Problem

I have a wpf DataGrid with a column of ComboBox and another column of TextBox. When I select the value on the ComboBox, I want the selected value to be displayed in the TextBox column on the same row. How can I do this. Thanks.

Original source