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
20
Fail to set value more than once on XamMultiColumnComboEditor
posted

I have an issue using XamMultiColumnComboEditor v16.1 within a DataTemplate.

<DataTemplate DataType="{x:Type fields:HistoryClientInfoFieldViewModel}">

<ig:XamMultiColumnComboEditor ItemsSource="{Binding Values}"
AutoGenerateColumns="False"
SelectedValuePath="Name"
DropDownButtonDisplayMode="Always"
SelectedItemsResetButtonVisibility="Collapsed"
Width="250">
<ig:XamMultiColumnComboEditor.Columns>
<ig:TextComboColumn HeaderText="Name" Key="Name"/>
<!--<ig:TextComboColumn HeaderText="OrderPlacer" Key="OrderPlacer"/>-->
</ig:XamMultiColumnComboEditor.Columns>
</ig:XamMultiColumnComboEditor>

</DataTemplate>

First when setting the focus on the element there is an exception 

exception thrown: 'System.InvalidOperationException' in PresentationCore.dll

Additional information: This Visual is not connected to a PresentationSource.

When attempting to set the value on the second time a null reference exception occurs.

Using  the control inside a UserControl seems to work for some reason.

Any idea what is going wrong?

Thanks

Parents
  • 34510
    Offline posted

    Hi Etienne,

    That's an interesting error.  How are you using that DataTemplate?  I see it has a DataType set which means it will automatically apply where HistoryClientInfoFieldViewModel is used but what parent control is expected to use this DataTemplate?  For example, I tried creating a ListView control and used that DataTemplate for each list item but did not produce any exception when focusing via Mouse click or Tabbing to it.  I tested using the last service release for 16.1 (16.1.20161.2231).

    Also, do you have a stack trace for the error?  I'm interested to see what method calls in the XamMultiColumnComboEditor are triggering the exception.

Reply Children