Solved

DataGrid AutoCompleteBox

Posted on 2010-09-06
3
1,415 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now