Hey. Bellow is some code we have to use the Infragistics.Controls.Editors.XamComboEditor in the XamDataGrid.
We need to use Infragistics.Controls.Editors.XamComboEditor due to the filtering options in the grid.
But we now need to know when the dropdown list is open. How to get that information out of the EditorTemplate?
----------------------------- XAML---------------------------------------------------
<Style TargetType="{x:Type igWpf:XamTextEditor}" x:Key="SupplyLocationComboBoxStyle" > <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igWpf:XamTextEditor}">
<igWpf:XamTextEditor
Text ="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type custom:DataRecordPresenter}}, Path=DataRecord.DataItem.SupplyLocation.IdAndName, Mode=OneWay}" HorizontalAlignment="Stretch" VerticalAlignment="Center"
/> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="EditTemplate"> <Setter.Value> <ControlTemplate> <uc:ComboEditor ItemsSource="{Binding DataItem.Locations}" SelectedItem="{Binding DataItem.SupplyLocation}" DisplayMemberPath="IdAndName" OpenDropDownOnTyping="True" Style="{StaticResource GridXamComboEditorStyle}" ExpandPopup="False" > </uc:ComboEditor> </ControlTemplate> </Setter.Value> </Setter>
</Style>
--------------------------------------- C# -----------------------------------------------------------------------------
using Infragistics.Windows.Editors;
namespace Dispatch.Client.Common.Views.UserControls{ public class GridTextEditorComboBox : XamTextEditor {
public bool IsDropDownOpen { get { Infragistics.Controls.Editors.XamComboEditor comboEditor = null; var editTemplate = EditTemplate; if (editTemplate != null) { comboEditor = (Infragistics.Controls.Editors.XamComboEditor) editTemplate;
} return comboEditor.IsDropDownOpen; } }
}}
Cheers, Øyvind
Hello Øyvind,
Thank you for your post!
I have been looking into your issue. What I can suggest is to use the Infragistics XamComboEditor. It has an IsDropDownOpen property. More about this property you can find on the following link from our documentation: http://help.infragistics.com/Help/Doc/WPF/2014.1/CLR4.0/html/InfragisticsWPF4.Editors.v14.1~Infragistics.Windows.Editors.XamComboEditor~IsDropDownOpen.html.
You can handle the DropDownOpened event of the editor to be notified when the drop-down is opened and closed.
Please do not hesitate to let me know if you have any further questions on this matter.
I am just checking your progress on this issue. Please do not hesitate to let me know if you have any further questions on this matter.