Hi Steven,
Thanks for using syncfusion products.
We have analyzed your query and you can achieve your requirement by modifying the following code snippet in you attached sample.
Code snippet[C#]:
GridDataColumnStyle columnstyle = new GridDataColumnStyle(); columnstyle.CellType = "ComboBox"; columnstyle.ItemsSource = ItemList; columnstyle.DropDownStyle = GridDropDownStyle.Exclusive; columnstyle.DisplayMember = "PhoneType"; columnstyle.ValueMember = "PhoneTypeID";
GridDataVisibleColumn column = new GridDataVisibleColumn(); column.ColumnStyle = columnstyle; column.MappingName = "CustomerName"; this.DataGrid.VisibleColumns.Add(column);
|
We have modified the sample based on your requirement and please find the sample under the following location.
Sample: WpfApplication2.zip
Please let us know if you have any queries.
Gobinath A
Hi Steven,
Thanks for your update.
We are unable understand your requirement, However we have prepared a sample based on the given information. Could you please check the sample? or please share more details related to this query with us, it would be helpful for us to provide a solution sooner.
Code snippet[C#]:
GridDataColumnStyle columnstyle = new GridDataColumnStyle(); columnstyle.CellType = "ComboBox"; columnstyle.ItemsSource = ItemList; columnstyle.DropDownStyle = GridDropDownStyle.Exclusive; columnstyle.DisplayMember = "PhoneType"; columnstyle.ValueMember = "PhoneTypeID";
this.DataGrid.VisibleColumns[0].ColumnStyle = columnstyle;
|
Sample: WpfApplication2.zip
Notes: We are glad to announce that our Essential Studio Vol 3 2013 is rolled out and is available for download under the following link.
Gobinath A
Hi Steven,
Thanks for your interest in syncfusion products.
We have analyzed your query and if we change the ComboBox Itemsource then we have to change the DisplayMember property also as following code snippet.
Code snippet[C#]:
columnstyle.DisplayMember = "PhoneType"; columnstyle.ValueMember = "PhoneTypeID"; |
Code snippet[XAML]:
<syncfusion:GridDataVisibleColumn MappingName="CustomerID" /> |
Notes: The MappingName(CustomerID) values should match the PhoneType value of ItemList collection for view the DisplameyMember in the CombobBox while loading.
Please let us know if you have any queries.
Gobinath A
Hi Heromyth,
You can achieve your requirement by setting DisplayMember in the GridDataColumnStyle. If you are set the DisplayMember in the column style, then the combo box will only display the particular column value in the dropdown list. We have created a sample to achieve this requirement and please check the below sample link.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/125167/comboboxdisplay-1925745908.zip
Please let us know if you have any queries.
Thanks,
Ashok