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" /> -->
Hello,
I believe that, rather than using SelectedValue and SelectedValuePath, you would use Value and ValuePath, respectively.
<igEditors:XamComboEditor Grid.Row="1" Grid.Column="1" Margin="2" ItemsSource="{Binding Facilities}" DisplayMemberPath="Name" Value="{Binding CurrentBatch.FacilityID}" ValuePath="FacilityID"/>
Please try this out and post back here is this does not work or you have further questions on this topic.
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
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 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 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); }
Fransis Sir,
Am waiting for ur reply can u give any solution. or how to overcome this prob? xamcomboeditor is this solution means how sir?
thanks
Hello Fransis Sir,
In my project i have xamgrid. 3 columns or cells in this grid . first cell i have combobox. in this combobox to select particular item means the remaining columns data ill fetch and assigned automatically if combobox is selectionchanged using tables . datas are fetch from sql table.my xaml are given below :
<ig:XamGrid HorizontalAlignment="Left" Margin="56,30,0,0" AutoGenerateColumns="False" CellEnteredEditMode="ManageRecipeStateGrid_CellEnteredEditMode " VerticalAlignment="Top" Height="212" Width="612" > <ig:XamGrid.Columns> <ig:ComboBoxColumn Key="Sub_Category_Code" DisplayMemberPath="Sub_Category_Code" x:Name="subcode" AllowEditingValidation="True" SelectedValuePath="Sub_Category_Code" HeaderText="subcategorycode "/> <ig:TextColumn Key="Sub_Category_Name_EN" HeaderText="SubCategory name En "/> <ig:TextColumn Key="Sub_Category_Name_AR" HeaderText="SubCategory name Ar"/> </ig:XamGrid.Columns> </ig:XamGrid>
i cant get comboboxselectionchanged event and combobox.selecteditem property.
pls can u solve my problem.
thank u so much sir.i ill try that codings.