Hi,
I use a regular ComboBox in an EditorTemplate without any problems. If I select something from the list, my dataobject is updated. Adding a new row also happens without problems.
I have a scenario where my EditorTemplate contains a MS AutoCompleteBox where the user searchs for a name in Active Directory. This works fine. The names are displayed in the AutoCompleteBox and I can select one from the list.
However:
When editing existing records, If I select a new name from the autocompletebox the new text from the selections is displayed. However, when I leave the Cell, the data is not updated.
If I add a new row when using a AutoCompleteBox as part of it, nothing happens. See attached four screenshots to illustrate the problem.
This is my XAML Code:
<igGrid:TemplateColumn x:Name="colExecutor" HeaderText="Executor" IsFixed="Left" Key="executorFullName" > <igGrid:TemplateColumn.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding executorFullName}" /> </DataTemplate> </igGrid:TemplateColumn.ItemTemplate> <igGrid:TemplateColumn.EditorTemplate> <DataTemplate> <input:AutoCompleteBox Populating="txtbExecutor_Populating" MinimumPopulateDelay="200" x:Name="txtbExecutor" Margin="6,2,0,2" ItemTemplate="{StaticResource showCN}" ValueMemberPath="cn" IsTextCompletionEnabled="False" /> </DataTemplate> </igGrid:TemplateColumn.EditorTemplate> </igGrid:TemplateColumn>
Any help would be appreciated,Nicolas
Thanks for your answer, it works now.
I'm still a bit new to the whole databinding story, and got somehow confused with the regular combobox and the binding in it's selecteditem property. (the one in the examples that uses converters)
I didn't see it myself when no SelectedItem is necessary (such in my case) that you have to set the binding to another property (in this case "Text")
Thank you that you have clarified this out for me.
Nicolas
Hi Nicolas,
I can't see any binding there that would update your DataSource.
You should add such binding:
<igGrid:TemplateColumn.EditorTemplate>
<DataTemplate>
<input:AutoCompleteBox Populating="txtbExecutor_Populating"
MinimumPopulateDelay="200"
x:Name="txtbExecutor"
Margin="6,2,0,2"
ItemTemplate="{StaticResource showCN}"
ValueMemberPath="cn"
IsTextCompletionEnabled="False"
Text={Binding executorFullName, Mode=TwoWay}"/>
</DataTemplate>
</igGrid:TemplateColumn.EditorTemplate>