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
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.
It is used in an items control containing other field model.So it is pretty much implicit datatamplte.The "expected parent" is simply a contentcontrol.
Oddly enough we dont get any stacktrace of the error.
version used is 16.1.20161.1000.
Hmm. I actually do see the possibility for an ArgumentNullException in the DragDropManager.GetUIElementParent method but I don't know how it could actually happen assuming the element that the DragSource is attached to is in the visual tree and I think it should be since the MouseLeftButtonDown event is firing which is what calls GetUIElementParent.
Speaking of the Infragistics DragDropManager, how are you using it in your app and how does it relate to the XamMultiColumnComboEditor? Based on the call stack it seems like an important part that my sample is missing so I'd like to try adding it in the same way it is used in your app.
We host elements in xamdatagrid styled as a list view.
Elements support drag and drop using drag drop manager. We use the drag drop manager to merge entries in the grid.
So at some point upon clicking an element on the grid inside the editor I've seen the drag drop procedure is activated on the MouseLeftButtonDown but unsuccessfully find a parent.
I logged a dev issue for this so our engineers can make some changes around that code to account for null values getting passed to the GetParent() method. While I was not able to reproduce this locally the GetUIElementParent() method is very small and there are only two places where LogicalTreeHelper.GetParent() are called so I figured it would be ok to log this along with the call stack you provided. The dev issue ID is 247206.
For now, continue to use your workaround. I will open a private support case for you soon where I will link to this dev issue so you can track its status. Be aware that development has stopped for 16.2 and below so any fix that is made will be in 17.1 and above. Once the case is created I will update this thread and let you know.
I created a private support case for you to track the dev issue I logged. The case number is CAS-189707-R7S0Q4 and you can view it here: https://es.infragistics.com/my-account/support-activity