Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
Issue when the EditTemplate is of type Infragistics.Controls.Editors.XamComboEditor
posted

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

Parents Reply Children
No Data