Hello,
I have a XamComboEditor whose ItemSource is bound to a list of KeyValuePairs. The DisplayMemberPath is bound to the value property, and the ValuePath is bound to the key. To give a specific example, there are two items in the list:
key=1 value="Debit"
key=-1 value="Credit"
What I want to do is programmatically set the value of the editor to 0 (i.e. not a valid value), have it display blank, and force the user to make a choice between the two valid selections. However, when I do this, the XamComboEditor displays "0". Am I missing something? Is there a way to get it to display blank in this case and give the user his two choices of Debit and Credit?
Thanks!
Bob
I have been looking into your post and if you use XAML XamComboEditor, you could set the ‘EmptyText’ property in order to prompt the users to select an item.
I am attaching a sample application(ComboEditorKeyValuePairs.zip) that shows my suggestion.
Let me know, if you need any further assistance on this matter.
Sorry, I neglected to say that I'm running v13.1. The 13.1 documentation says EmptyText is supported, but in reality it is not available. Does this feature require an upgrade to 13.2? Or is there another way to do it?
Hi,
Thank you for your reply. I have been looking into it and it seems that you may use the WPF specific XamComboEditor:
http://help.infragistics.com/doc/WPF/2013.1/CLR4.0/?page=xamComboEditor.html
instead of the XAML XamComboEditor:
http://help.infragistics.com/doc/WPF/2013.1/CLR4.0/?page=XAML_xamComboEditor.html
In order to use the ‘EmptyText’ property, I can suggest using the XAML XamComboEditor.
I am attaching my sample application(ComboEditorKeyValuePairs_13.1.zip) with the assembly files for vol. 13.1.
What is the difference between them (I understand one is WPF specific and the other is "XAML cross platform")? Will this break anything else? (I use the XamComboEditor all over the place in my application.) What are the reasons for using one version over the other in a WPF thick client (non Silverlight) application? Why are there two versions at all?
I am looking at your sample application. Our use of XamComboEditor (again in LOTS of places in our application) relies on being able to bind its Value property to a property in our model. The XAML XamComboEditor does not have a Value property, so the way one has to implement it looks to be dramatically different from the WPF XamComboEditor. Am I missing something?
Hello Bob,
Thank you for your reply. The XAML XamComboEditor is a cross platform control between WPF and Silverlight and we have added after adding the WPF specific one in our WPF packages. It provides some different options than the igEditors:XamComboEditor like multi selection and it is not an ItemControl and you cannot add items directly in XAML. It must be strictly bound to data. It is not extended version of the WPF Specific XamComboEditor.
In our upcoming Infragistics for WPF vol.14.1 we have added properties like ‘SelectedValue’ and ‘SelectedValuePath’ in the XAML XamComboEditor.
It looks to me like this control has some potentially useful features, but I have to figure out how to get by without a SelectedValuePath type of property. That complicates things a lot for my application; I really need to be able to bind the selected value to property in my viewmodel. Kinda frustrating that something that seems so basic (and that is in the WPF-specific version) isn't there already. Must invent a way around not having it only to have to undo it again when 14.1 comes out....
Thanks for your help.
No, I suppose not. Thanks.
I am just checking if you require any further assistance on the matter.
I have been looking into your post and you can change the ItemTemplate of the WPF specific XamComboEditor using the ‘ComboBoxStyle’ like e.g. :
<igEditors:XamComboEditor.ComboBoxStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Make}" Width="50" />
<TextBlock Text="{Binding Model}" Width="100" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</igEditors:XamComboEditor.ComboBoxStyle>
Currently the WPF specific XamComboEditor does not provide a property like ‘EmptyText’ which is available in the XAML XamComboEditor.
After working on this and doing some research, the adding of ‘EmptyText’ property in the WPF XamComboEditor has been determined to be a new product idea. You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
There are many benefits to submitting an product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
In the upcoming Infragistics WPF 14.1 the XAML XamComboEditor will provide a ‘SelectValue’ property which could be bound to a property from the ViewModel.
Which brings me back to the problem that prompted me to post originally... I also need the "EmptyText" (and for that matter "ItemTemplate"), which are available only in the XAML control.
Thank you for your reply. I have been looking into your scenario and currently the best approach could be to use the WPF specific XamComboEditor because this way you have the ability to bind its ’Value’ property. I am attaching a sample application(ComboEditorKeyValuePairs_WPFEditor.zip) this this editor.
Let me know, if you need any further assistance on this.