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
Trying to reproduce the issue.
Doesnt occur by simply putting the into a template.
So havnt found a way to reproduce it in a simple project.
The only thing new i found is that the exception only occur if I click on a an area with text. The adventure got a lot stranger.
So ill keep trying to repoduce it.
I switched to a WrapPanel as the ItemsPanel but that didn't seem to change anything. Can you update the sample I attached in my last update to reproduce the exception and then send it back to me so I can debug it?
Also it is used in an items control with wrap panel as a panel template
All exceptions were turned on when i encountered the error. And no details options in the exception window
Ok, try turning on "Common Language Runtime Exceptions" and reproducing the exception. This option is in Visual Studio in the top menu (Debug -> Windows -> Exception Settings). Maybe there is an exception before the one you see that is handled and that puts things into a bad state causing this one. So we'll want to break on that exception instead of handling it. Not really sure but worth a shot. Also, make sure you check the inner exception on the exception you see as most times with things like this the true exception is hidden in there. The exception dialog should have a "View Detail" option at the bottom.
I tried switching my ListView to an ItemsControl and I just let the implicit DataTemplate do its thing but I still don't see an exception when focusing the combo editor. I have attached my sample (it's very basic) so let me know if there's anything I'm missing that is required to reproduce this.
0564.ComboEditorImplicitTemplate.zip