Hi, I am using XamComboEditor(Infragistics.Controls.Editors.XamComboEditor). And I tried to Bind with ItemsSource property of XamComboEditor with MyProperty which is type of ObservableCollection<string>. The codebehind info: public partial class Window11 : Window { public ObservableCollection<string> myProperty;
public ObservableCollection<string> MyProperty { get { return myProperty; }
set { myProperty = value; } }
public Window11() { InitializeComponent(); Load(); }
public void Load() { myProperty = new ObservableCollection<string>(); LoadXamCombo(); xam.DataContext = MyProperty; }
public void LoadXamCombo() { MyProperty.Add("Active"); MyProperty.Add("InActive"); } } Xaml Code: <ig:XamComboEditor ItemsSource="{Binding Path=MyProperty,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}" CheckBoxVisibility="Visible" AllowMultipleSelection="False" Name="xam" Height="10" /> When I tried to expand the control , I observed as instead of Active & InActive values, 6 and 8. I am attaching the screenshot as an attachment. Could you please help, where i did mistake and How to get the values in XamcomboEditor "Active" & "InActive" Thanks in advance.. Regards, Chandra
Forgot to add screenshot.
Added now.
Hi,
I got some information from below article.
http://es.infragistics.com.es/community/forums/p/69435/351753.aspx
>>
public partial class Window11 : Window { public ObservableCollection<string> myProperty;
public ObservableCollection<Test> test = new ObservableCollection<Test>();
public void Load() { myProperty = new ObservableCollection<string>(); LoadXamCombo();
// xam.DataContext = test; }
public void LoadXamCombo() { //MyProperty.Add("Active"); //MyProperty.Add("InActive");
test.Add(new Test { Status = "Active" }); test.Add(new Test { Status = "InActive" });
} }
public class Test { public string Status { get; set; } }
<<
Without setting Observablecollection to DataContext in code behind can achieve the same through Xaml?
Xaml code:
<ig:XamComboEditor ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:Window11}},Path=test}" DisplayMemberPath="Status" Height="10" Name="xam"/>
Could you please let me know, How to bind ItemSource to xamComboEditor
Thank you,
Chandra