troubleshooting Question

SIlverlight Combobox Datagrid

Avatar of Kevin Robinson
Kevin Robinson asked on
Microsoft Development
10 Comments1 Solution1472 ViewsLast Modified:
I have a combo boxs in the data grid below. It lists the look table contents fine but when I select an option from the combo box all the records get the same value.  I can change the description fine so that the description is different for each record.

so for example if i change a project code from Core to VBI in the table below.

Description         ProjectCode
-------------------------------------------
Test 1 xxx          Core
Test 2 xxx          VBI
Test 3 xxx          MV


I Get this
Description         ProjectCode
-------------------------------------------
Test 1 xxx          VBI
Test 2 xxx          VBI
Test 3 xxx          VBI

                 
<my:DataGrid Name="dgMonday"  HorizontalAlignment="Left"  
                                 AutoGenerateColumns="False" Height="200" Width="825" IsReadOnly="False"  
                                 ItemsSource="{Binding Data, ElementName=TimeSheetsDataSource}" >
                    <my:DataGrid.Columns>
                                    
                                    <my:DataGridTextColumn Header="Description" Width="300" Binding="{Binding DescrTask}" />

                                    <my:DataGridTemplateColumn Header="Project">
                                        <my:DataGridTemplateColumn.CellTemplate >
                                            <DataTemplate>
                                                <StackPanel>
                                                    <ComboBox 
                                                         ItemsSource="{Binding Path=Data, Source={StaticResource ProjectTypeDataSource}}"
                                                        SelectedItem="{Binding Path=SelectOption, Mode=TwoWay}" 
                                                        HorizontalAlignment="Left"
                                                        DisplayMemberPath="ProjectCode"   
                                                        SelectedValuePath="ProjectId"  Width="100"
                                                        SelectedValue="{Binding ProjectId, Mode=TwoWay}" Margin="0"/>
                                                </StackPanel>
                                            </DataTemplate>
                                        </my:DataGridTemplateColumn.CellTemplate>
                                    </my:DataGridTemplateColumn>

                                 
                                    <my:DataGridTextColumn Header="UserName" Width="50" Binding="{Binding UserName}" />
                                </my:DataGrid.Columns>
                            </my:DataGrid>
ASKER CERTIFIED SOLUTION
Ashok
Sr. Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros