Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DataGrid AutoCompleteBox

Posted on 2010-09-06
3
Medium Priority
?
1,462 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 2000 total points
ID: 33627139
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

972 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