Hi,
I have a XamComboEditor with the property AllowMultipleSelection="True". It is binded to a observable collection of AircraftType object which contains a property IsActive. I would like to have the drop down items foreground color displayed in red when this property is set to "false". Also, if one or more of "inactive" items is selected, I would like them also to be displayed in red in the drop down selected items summary. ex: A340,<red>A320</red>,A310
Is it possible to do this with the XamComboEditor? And, if yes, what is the best way to do it?
Best regards
Hello Antoine,
Thank you for the detailed description you have provided in regards to the desired functionality.
In order to change the Foreground of the ComboEditorItemControl elements based on a property value from the underlying data item instance, you can set the ItemContainerStyle property of the editor and use a trigger for the Foreground. (refer to the attached sample application)
For example:
// The Data property of the item is our data item instance, or in your case - the AircraftType object.
<ig:XamComboEditor.ItemContainerStyle> <Style TargetType="{x:Type ig:ComboEditorItemControl}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=Item.Data.IsActive, RelativeSource={RelativeSource Self}}" Value="False"> <Setter Property="Foreground" Value="Red" /> </DataTrigger> </Style.Triggers> </Style></ig:XamComboEditor.ItemContainerStyle>
Since the selected items of the editor are contained as text within a single TextBoxPresenter, the functionality of styling each item individually has been determined to be a now product idea. You can suggest new Product Ideas for future versions (or vote for existing ones) at http://ideas.infragistics.com.
Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea 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.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.
If you have any questions, please let me know.
Hi
Thank you for you response.
I have a small problem with the solution that you proposed me. It is easily reproducible in the sample you provided me. If you but a lot more items in the collection (ex: 40 items) and you make the items 7 and 37 inactive for example. When you start scrolling up and down in the drop down. The red items changes, sometimes it is the right one, but sometimes it is the one above or below it.
Do you know how to fix this?
Best Regards
Antoine Charbonneau
The issue you have described in regards to the random styling of the ComboEditorItemControl elements has already been fixed internally and will be included in the next service release. I have linked this thread to Development Issue 240777 so that you will be notified when the service release is available. You can see the service release schedule here: http://www.infragistics.com/support/service-releases
Let me know if you have any questions.