We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Wrong display of TreeGridComboBoxColumn

Thread ID:

Created:

Updated:

Platform:

Replies:

127749 Dec 6,2016 10:55 AM Dec 13,2016 05:43 AM WPF 3
loading
Tags: SfTreeGrid
Bpedroni
Asked On December 6, 2016 10:55 AM

The configuration of the DisplayMemeberPath isnt used to display the value in the combobox.

Example :

public class Person
{
       public string FirstName {get;set;}
       public int CountryId {get;set}
}
public class Country
{
       public int Id {get;set}
       public string Name {get;set}
}

Let's consider a SfTreeGrid bind to a list of persons and with a column defined so :

 <Syncfusion:TreeGridComboBoxColumn DisplayMemberPath="Name"
                              HeaderText="Country"
                              ItemsSource="{Binding DataContext.Countries, RelativeSource={RelativeSourceAncestorType=referenceDataManagement:PersonEditorView}}"
                              MappingName="CountryId"
                                                                              ValueBinding="{Binding CountryId,Mode=TwoWay}"
                              SelectedValuePath="Id"/>


Then, the bind is working correctly (update the country of the person) but always the Id is displayed instead of ther Country name.

Thanks for your help.

Muthukumar Kalyanasundaram [Syncfusion]
Replied On December 8, 2016 12:23 PM

Hi Bpedroni, 

Thank you for contacting Syncfusion support. 
  
We have checked your code snippet.  In that you have binding the CountryId for MappingName . Hence the CountryId value is displayed in grid cell. If you want to display the TreeGridComboBoxColumn based on CityName, then you need to bind the CityName property to MappingName. By default, the TreeGridComboBoxColumn of MappingName property value will be shown in grid cell instead of DisplayMemberPath property value and the SelectedValuePath property is used to get the selected path value of the selected item. The comboBox items will be shown based on DisplayMemberPath. This is the behavior of SfTreeGrid. Could you please refer the below UG document link for further reference, 
  
  
Please let us know if you have any concerns. 

Regards, 
Muthukumar K 


Bpedroni
Replied On December 12, 2016 04:33 AM

Hello,

Your solution means that the Country Name (not the CityName) is exposed in the Person class.

In my example, only the Country Id is exposed in the class and should be, so the bind has to be done on the Id and display the name in the list.

If I do exactly the same but with a SfGridView and with this column :

 <Syncfusion:GridComboBoxColumn DisplayMemberPath="Name"
                               HeaderText="Country"
                               ItemsSource="{Binding DataContext.Countries, RelativeSource={RelativeSourceAncestorType=referenceDataManagement:PersonEditorView}}"
                               MappingName="CountryId"
                                                                              ValueBinding="{Binding CountryId,Mode=TwoWay}"
                              SelectedValuePath="Id"/>

then it works correctly.

Can the behavior be the same for treeview please ?

Thanks.

Muthukumar Kalyanasundaram [Syncfusion]
Replied On December 13, 2016 05:43 AM

Hi Bpedroni, 

Sorry for the inconvenience caused. 

We are able to reproduced the “Wrong display of TreeGridComboBoxColumn” issue. A support incident to track the status of this issue has been created under your account. Please log on to our support website to check for further updates. 
  
  
Please let me know if you have any questions. 
  
Regards, 
Muthukumar K 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;