Link to home
Start Free TrialLog in
Avatar of ProdigyOne2k
ProdigyOne2k

asked on

DataGrid AutoCompleteBox

I have a DataGrid which imports the line items (Partnumber, etc) into a DataGrid - it loads fine - looks perfect.

Now the problem Is I need it to be editable - and I want it to have an AutoCompleteBox in the PartNumber column.

I have 2 DomainDataSource's - One which contains the data for the order in the DataGrid ("POContent") - and one which contains all of the PartNumbers which loads into the AutoCompleteBox ("GetPOPartNumbers").

Every time I hit "SubmitChanges" - no changes are detected.  What I need is the new PartNumber the client chooses in the AutoCompleteBox (aka: PartNumber1) to be mapped to the "PartNumber" in the DataGrid (aka: PartNumber) - and then to have the changes submitted.

From what I can tell because I'm selecting a PartNumber from the AutoCompleteBox that is connected to PartNumber1 - so when SubmitChanges is used it's not using the new part number and commiting to "POContent" - it's only connected to "GetPOPartNumbers" which has no changes.

Any help - much appreciated - below is my current code.

<sdk:DataGridTemplateColumn Header="Part Number" Width="200">
                                <sdk:DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBox Text="{Binding PartNumber, Mode=TwoWay}"/>
                                    </DataTemplate>
                                </sdk:DataGridTemplateColumn.CellTemplate>
                                <sdk:DataGridTemplateColumn.CellEditingTemplate>
                                    <DataTemplate>
                                        <sdk:AutoCompleteBox ItemsSource="{Binding Data, Source={StaticResource GetPOPartNumbers}}" ValueMemberBinding="{Binding PartNumber1, Mode=TwoWay}" IsTextCompletionEnabled="True" Width="200" Text="{Binding Path=PartNumber1}">
                                            <sdk:AutoCompleteBox.ItemTemplate>
                                                <DataTemplate>
                                                    <TextBlock Text="{Binding Path=PartNumber1}" />
                                                </DataTemplate>
                                            </sdk:AutoCompleteBox.ItemTemplate>
                                        </sdk:AutoCompleteBox>
                                    </DataTemplate>
                                </sdk:DataGridTemplateColumn.CellEditingTemplate>
                            </sdk:DataGridTemplateColumn>
Avatar of John (Yiannis) Toutountzoglou
John (Yiannis) Toutountzoglou
Flag of Greece image

Avatar of ProdigyOne2k
ProdigyOne2k

ASKER

The above code unfortunately did not help me
ASKER CERTIFIED SOLUTION
Avatar of Anil Golamari
Anil Golamari
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial