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
15
2nd ComboBoxField Filter display the ValuePath instead of DisplayMemberPath
posted

I'm using infragistics 14.2 ,in a XamdataGrid charged by a MvvM, the 2nd comboboxfield filter diplay de ValuePath instead of DisplayMemberPath but the 1st comboboxfield filter it works well 

 

2nd ComboBoxField

1st Combo box

Both ComboBoxFied use a ObservableCollection<ClsObjetoComboxGuid> as Itemsource

ClsObjetoComboxGuid.cs

public class ClsObjetoComboxGuid
    {
        private Guid _Clave;
        private string _Texto;

        public ClsObjetoComboxGuid()
        {
            
        }

        public ClsObjetoComboxGuid(Guid pClave, string pTexto)
        {
            Clave = pClave;
            Texto = (string.IsNullOrEmpty(pTexto)) ? Clave.ToString() : pTexto;
        }

        public Guid Clave
        {
            get => _Clave;
            set => _Clave = value;
        }
        public string Texto
        {
            get => _Texto;
            set => _Texto = value;
        }
        public override string ToString()
        {
            return Texto;
        }
    }

Part of Example.xaml

                <igDP:XamDataGrid x:Name="XdgDatos"
                              DataSource="{Binding ListaNodoIncidencia}"
                              ActiveDataItem="{Binding SmNodoIncidenciaMvvM}"
                              AutoFit="True" GroupByAreaLocation="None"
                              Width="Auto" Height="Auto"
                              Margin="10" Grid.Row="1">
                <igDP:XamDataGrid.FieldSettings>
                    <igDP:FieldSettings AllowRecordFiltering="True" AllowEdit="False" Width="Auto"/>
                </igDP:XamDataGrid.FieldSettings>
                <igDP:XamDataGrid.FieldLayoutSettings>
                    <igDP:FieldLayoutSettings
                        AutoGenerateFields="False"
                        AutoFitMode="Always"
                        AllowAddNew="False"
                        AllowDelete="False"
                        SelectionTypeRecord="Single"
                        HighlightAlternateRecords="False"/>
                </igDP:XamDataGrid.FieldLayoutSettings>
                <igDP:XamDataGrid.FieldLayouts>
                    <igDP:FieldLayout>
                        <igDP:FieldLayout.Fields>l="{Lex:Loc ChkBaja}"/>
                            <igDP:ComboBoxField Name="SmNodoUid" Label="{Lex:Loc LblSmNodo}" 
                                                DisplayMemberPath="Texto" ValuePath="Clave" 
                                                ItemsSource="{Binding RelativeSource={RelativeSource Self},Path=Owner.DataPresenter.DataContext.ListaSmNodo}"/>
                            <igDP:ComboBoxField Name="SmIncidenciaUid" Label="{Lex:Loc LblIncidencia}" 
                                                DisplayMemberPath="Texto" ValuePath="Clave" 
                                                ItemsSource="{Binding RelativeSource={RelativeSource Self},Path=Owner.DataPresenter.DataContext.ListaSmIncidencia}"/>
                        </igDP:FieldLayout.Fields>
                    </igDP:FieldLayout>
                </igDP:XamDataGrid.FieldLayouts>
                </igDP:XamDataGrid>

Part of MvvM.cs

class SmNodoIncidenciaListaMvvM : GeneralMvvM
{
        private ObservableCollection<SmNodoIncidenciaMvvM> _ListaNodoIncidencia;
        private ObservableCollection<ClsObjetoComboxGuid> _ListaSmNodo;
        private ObservableCollection<ClsObjetoComboxGuid> _ListaSmIncidencia;
        public ObservableCollection<ClsObjetoComboxGuid> ListaSmNodo
        { 
            get => _ListaSmNodo;
            set
            {
                _ListaSmNodo = value;
                NotifyPropertyChanged();
            }
        }
        public ObservableCollection<ClsObjetoComboxGuid> ListaSmIncidencia {
            get => _ListaSmIncidencia;
            set
            {
                _ListaSmIncidencia = value;
                NotifyPropertyChanged();
            }
        }
       public ObservableCollection<SmNodoIncidenciaMvvM> ListaNodoIncidencia
        {
            get => _ListaNodoIncidencia;
            set
            {
                _ListaNodoIncidencia = value;
                NotifyPropertyChanged();
            }
        }
}

Thanks for your attention, regards.

Parents Reply Children