Hi,
I was previously using WPF 11.2 controls, XamComboEditor specifically.
I migrated my project from 11.2 to 12.1 and what I see the xamComboEditor which was working fine n 11.2 is not working in 12.1.
The code is exactly the same in both case, in 11.2 the binding is working fine and in 12.1 the data shown in combobox is the length of the characters of the data and not the actual data.
Description:
In Version 11.2 - I have a ObservableCollection<string>. Binding this to the xamcomboeditor (11.2) give names of the employees on the UI.
In Version 12.1 - I have a ObservableCollection<string>. Binding this to the xamcomboeditor (12.1) give length of the names of the employees on the UI and not the names of the Employees.
Please help. This is a very weird situation.
Hello,
The issue that you are referring is caused because of some changes that we made over the design behavior of the XamComboEditor- it will no longer support binding to simple type such as strings. The best thing to do if you encounter this issue is to wrap the string in a custom object and set the display member path of the XamComboEditor to point to the string property that contains the string that should be displayed.
If you have any additional questions on this matter please feel free to ask.
Thanks for the updates. Atleast all these internal changes have affected our project very much. We have to do many changes to support your current controls.
Atleast, you should notify all these changes so, that we can reduce our development time.
For now, we have taken an ItemTemplate with a TextBlock and done a simple binding. (Text="{Binding}")
I hope this would not affect anyother of our implementation?
Thanks,
VJ
Hi VJ,
By default our XamComboEditor doesn’t support binding to string collections, so although this functionality was available in some releases we recommend using the control bound to object and setting of the DisplayMemeberPath property.
Still I can see your concerns about the changes in this behavior so please excuse us for the inconvenience.
Hello VJ,
I was just wondering did you have a chance to try my suggestion. If you still need any assistance on the matter, please do not hesitate to ask.
Hi Elena
I am having the same problem in my code
<Grid.Resources> <ObjectDataProvider x:Key="trancheType" MethodName="GetTrancheTypes" ObjectType="{x:Type chroma:TrancheTypeList}" /> </Grid.Resources>
<ig:XamComboEditor Name="trancheType" FontWeight="bold" Height="20" Margin="168,75,5,63" Width="127" Padding="3,2" Grid.Row="1" SelectionChanged="xamComboEditor_SelectionChanged" AllowMultipleSelection="True" EmptyText="Choose ..." ItemsSource="{Binding Source={StaticResource trancheType}}" IsEditable="False"></ig:XamComboEditor>
public class TrancheTypeList { public ObservableCollection<string> GetTrancheTypes() {
if (SearchMisc.GetTrancheTypes(Window1.MiscDtFrom, Window1.MiscDtTo) == null) return new ObservableCollection<string>(); else { ObservableCollection<string> lst = SearchMisc.GetCollectionFromDataset(SearchMisc.GetTrancheTypes(Window1.MiscDtFrom, Window1.MiscDtTo)); return lst; } } }
How do I solve this problem?
As Elena explained you can wrap the String into custom object with a String Porperty and set this Property to be the XamComboEditor's DisplayMemberPath or you can use the approach VJ suggested - using ItemTempalte with TextBlock with simple binding.