Can some one please show me the equivalent xaml for the XamComboEditor based on the MS ComboBox xaml below? The MS version works great. I'm new to WPF and am a bit lost in all the intricacies of data binding.
Thanks!
<igEditors:XamComboEditor Grid.Row="1" Grid.Column="1" Margin="2" ItemsSource="{Binding Facilities}" DisplayMemberPath="Name" />
<!-- <ComboBox Grid.Row="1" Grid.Column="1" Name="c1ComboBoxFacilityID" Margin="2" ItemsSource="{Binding Facilities}" DisplayMemberPath="Name" SelectedValue="{Binding CurrentBatch.FacilityID}" SelectedValuePath="FacilityID" /> -->
Hi again,
OK, if you are running CLR3, then I'm pretty sure the "Shared XAML" controls will not be available to you, as they are built on CLR4. That said, I have put together the attached sample that demonstrates the binding of a XamComboEditor (CLR3) to a collection of items in the C# code behind. Please review it and let me know how it works for you.
PS - I just realized that I created a VS2010 project, which I assume you will not be able to open. You can then still look at the code files and if needed port them into a VS2008 project.
The code itself looks like this:
private void Window_Loaded(object sender, RoutedEventArgs e) { ViewModel vm = new ViewModel(); XamComboEditor xce = new XamComboEditor(); xce.Height = 40; xce.Width = 250; Binding b = new Binding("Employees"); b.Source = vm; xce.SetBinding(XamComboEditor.ItemsSourceProperty, b); xce.DisplayMemberPath = "Name"; this.LayoutRoot.Children.Add(xce); }
thanks sir, your reply is useful for me. but we r using trail version in that wpf3 only, and also how to bind the itemsource to that control ?how its?
Hi Deepalakshmi,
If, for example, you want to instantiate a XamComboEditor from the Shared XAML controls, your project needs to reference the followingassemblies (you can get the references also by dragging the control onto the design window then deleting it.):
InfragisticsWPF4.Controls.Editors.v11.2InfragisticsWPF4.DataManager.v11.2InfragisticsWPF4.v11.2
Your cs file will declare:
using Infragistics.Controls.Editors;
And a very simple set up could be something like:
XamComboEditor xce = new XamComboEditor(); xce.Height = 40; xce.Width = 200; this.LayoutRoot.Children.Add(xce);
I hope this answers your question.
Thanks,
Hi,
ur answer is useful but i cant use this comboeditor name in xaml.cs page .how can i use that name in my cs page ?can u help me
Does the shared control have any similar functionality?