Hi,
XamComboEditor internally uses a ComboBox in its edit template. You can specify a style to apply to this combo box using the XamComboEditor's ComboBoxStyle property. This is where you can specify any properties like the ItemTemplate that you want to apply to the combo box.
Hope this helps,
Sandip
Can we get a more elaborate response.
I'm very confused as to how to apply an Items Template for when the XamComboEditor is expanded and then show a different Template to when it's closed. It seems that the ComboBox control does this rather easy and I'm wondering why it seems harder to do using the XamComboBox control.
Thanks
I will create a support case on your behalf so that we can continue the discussion there.
Hi Alex. I know we have to similiar threads working the same problem. It seems the grid in the combo it proving to be to complicated.
What I'm trying to mimic is the following example I have using a ComboBox. I can't seem to mirror the same functionality with a XamComboBox.
Basically I have a Users List with 3 columns. Name, Phone and SocialSecurity number. I bind it as the Item Source (athough I would plan to use and ItemsProvider if I can get this to work for the XamComboEditor. Using the Items template selector I either want to show it one way (when the combo is opened with the 3 columns. or another when the user selects a comboItem (just one column). How do I do this with the XamCombo? Essentially this is exaactly what I want but I want to use your control.
Here is my xaml.
<ComboBox Margin="138,39,20,0" Name="comboBox1" ItemsSource="{Binding Users}" SelectedValuePath="Name" SelectedValue="{Binding User}" Height="23" VerticalAlignment
="Top">
<ComboBox.ItemTemplateSelector
>
<WPFSandbox:TemplateSelector
/>
</ComboBox.ItemTemplateSelector
<ComboBox.Resources
<DataTemplate x:Key
="DropDownTemplate">
<StackPanel Orientation
="Horizontal">
<TextBlock Text="{Binding Name}" Width
="100" />
<TextBlock Text="{Binding Phone}" Width
<TextBlock Text="{Binding SocialSecurity}" Width
</StackPanel
</DataTemplate
="SelectionTemplate">
</ComboBox.Resources
Here is the Template Selector:
DataTemplateSelector
{
container)
)container;
)
);
// Templated parent is ComboBoxItem
</ComboBox
Thanks again for all the help.. Sorry for the multiple posts..
This is because the XamComboEditor has not ended its edit mode and the value is not updated until then. It ends edit mode when you click away (lose focus), so you need to force it to end edit mode when you select an item:
x.EndEditMode(true,true);
You have not provided any code-behind (the part where you select an item) so I really cannot give you the exact code, but you should call the EndEditMode(...) of the XamComboEditor when the item is selected.
Hi Alex. If I set the DisplayMember prop it does show the correct item when I click away from the ComboBox. The problem is when I select the item it then shows that entire item in the combobox till I click away. How do we make it so it just shows the one item as if I did click away?
I know you did something like this in the other example but since it's mixed up with all the gris stuff I couldn't figure out what to do. Can you look at the sample code I attached in my previous post give an example from that?
Thanks for all the help..
Hello,
I believe this is the DisplayText property. You can create a converter (IValueConverter) for the ValueToDisplayText property of the XamComboEditor.
I have created a sample with a XamComboEditor with XamDataGrid inside it, and when a record from the XamDataGrid is selected, only one column is displayed as text.
You can see that on the thread below (a sample included also):
http://community.infragistics.com/forums/t/26793.aspx
Hope this helps.