How to display multiple fields in the sftextbox once a value is selected

Hello,

I use the sftextboxExt for the search of customers in my application and I can quite simply propose, in the Autocomplete, the list of my customers with their first names and their lastnames, with the code below:
      ...
           <syncfusion:SfTextBoxExt.AutoCompleteItemTemplate>
                <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock x:Name="firstName" FontWeight="Medium" Text="{Binding Prenom}"/>
                            <TextBlock x:Name="lastName" FontWeight="Medium" Margin="5,0,0,0" Text="{Binding Nom}"/>
                        </StackPanel>
                </DataTemplate>
           </syncfusion:SfTextBoxExt.AutoCompleteItemTemplate>
     </syncfusion:SfTextBoxExt>

But when the user makes his choice, the sftextBoxExt only displays the name :
How to display the firstname and lastname (for example) after the selection?

In advance, thank you for your help

Thomas


3 Replies

MS Mugundhan Saravanan Syncfusion Team July 5, 2018 06:13 PM UTC

Hi Thomas,

Thanks for Contacting Syncfusion support.

We have analyzed the reported requirement “Display the both names in the Textbox after selecting “. We have achieved this by using the SelectionChangedEvent. Please have the workaround sample from the following link

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/WpfApp1new-1758098924  

Generally, In our code implementation we have custom data template for the suggestion list not for TextBox directly.so we have use the selectionchanged event and add the both items into the current textbox.

Please let us know if you have any other concern.

Regards,
Mugundhan S. 



TO Thomas OMER-DECUGIS July 17, 2018 08:19 AM UTC

Thank you Mugundhan, it works.

Best regards,

Thomas OD


SS Sridevi Sivakumar Syncfusion Team July 19, 2018 11:01 AM UTC

Hi Thomas,

Thanks for your update.
We are glad to know your problem has been solved.
Please let us know if you have any other concern .
 
Regards,
Sridevi S.
 


Loader.
Up arrow icon