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
190
trouble while using SelectedItem property
posted

I use a XamComboeditor. Not in a XamDataGrid.

I use the MVVM pattern.

Then this xamcomboeditor is define like this:

<ige:XamComboEditor

ItemsSource="{Binding Products}"

SelectedItem="{Binding SelectedProduct, Mode=TwoWay, UpdateSourceTrigger=LostFocus}"

/>

In the ViewModel, I have:

public List<ProductVM> Products{get; private set;}

private ProductVM _selectedProduct;

public ProductVM SelectedProduct

{

get{return _selectedProduct;}

set{

if(_selectedProduct==value)

return;

_selectedProduct=value;

RaisePropertyChanged(nameof(SelectedProduct));

}

}

But, when I select an item in my view, In the set SelectProduct poperty, the value is always null.

I don't understand why.

For info, the Products collection is only load one time.

Could someone give me a trick?

For info, there are a lots of styles in this project. As I'm not a expert on styles, I don't know how to identify which style could disturbed the basic behavior.

Thanks in advance for your help

  • 34810
    Offline posted

    Hello Christophe,

    I have been investigating into the behavior you are seeing and have put together a sample project that is heavily based on the code you have provided, but at the moment I am unable to reproduce the behavior you are seeing. As such, I believe I will need some more information about the styles that you are currently applying as they pertain to the XamComboEditor, as well as ComboBox because the XamComboEditor uses a ComboBox internally. Any information you can provide on the styles you are applying may be helpful.

    I have attached the sample project I used to test this.  Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.

    If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.  My test was performed using version 19.1.20191.244 in Infragistics for WPF 2019 Volume 1.

    If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.

    Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

    Please let me know if you have any other questions or concerns on this matter.

    XamComboEditorSelectedItemTest.zip