Solved

DataGrid AutoCompleteBox

Posted on 2010-09-06
3
1,431 Views
Last Modified: 2012-05-10
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>
0
Comment
Question by:ProdigyOne2k
3 Comments
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33612494
0
 

Author Comment

by:ProdigyOne2k
ID: 33613611
The above code unfortunately did not help me
0
 
LVL 18

Accepted Solution

by:
Anil Golamari earned 500 total points
ID: 33627139
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Generate Numbers in JQuery file 11 66
Passing data between Forms 3 20
VS 2017 18 53
DataMember property 'tablename' cannot be found on the DataSource. 4 26
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question