Solved

DataGrid AutoCompleteBox

Posted on 2010-09-06
3
1,435 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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