Hi I have an XamDatagrid with an UnboundField that is an ComboEditor. So when im setting the DataContext of the Page which holds the DataGrid with an ViewModel.
_DetailFenster.DataContext = _ReminderViewModel;
Everything is Binded only the ComboBox remains empty.
I get if using this code an BindingExpression. I also tried some other Solutions without getting any BindingExpressions but the List remains empty.
Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Nummern; DataItem=null; target element is 'ComboBoxItemsProvider' (HashCode=11186660); target property is 'ItemsSource' (type 'IEnumerable')
if you need any further Information let me know.
thanks in advance
regards Mark Buggermann
this is the Property in the ViewModel which is holding the List
public ObservableCollection<ViewModelNummern> Nummern
{
get { return this._Nummern; }
set
if (this._Nummern != value)
this._Nummern = value;
this.NotifyPropertyChanged("Nummern");
}
<igDP:XamDataGrid Name="DataGridDetailAnsicht" DataSource="{Binding}" Background="Transparent" > <igDP:XamDataGrid.Resources> <igEditors:ComboBoxItemsProvider x:Key="ComboItemsProvider" ItemsSource="{Binding Path=Nummern,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> </igDP:XamDataGrid.Resources> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False" /> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:UnboundField BindingPath="Deadline" Label="Deadline" ></igDP:UnboundField> <igDP:UnboundField BindingPath="Name" Label="Name"></igDP:UnboundField> <igDP:UnboundField BindingPath="Bezeichnung" Label="Bezeichnung"></igDP:UnboundField> <igDP:UnboundField BindingPath="Count" Label="Count"></igDP:UnboundField> <igDP:UnboundField Name="Nummern" > <igDP:UnboundField.Settings> <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamComboEditor}"> <Setter Property="ItemsProvider" Value="{DynamicResource ComboItemsProvider}"/> <Setter Property="DropDownButtonDisplayMode" Value="MouseOver"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:UnboundField.Settings> </igDP:UnboundField> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
Hello mabube,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
If this is what you were looking for please verify the answer so it helps other users as well.
I apologize that this post was not answered sooner. We are making the effort to ensure all posts are addressed by an Infragistics expert. We believe that the other community members could benefit from this thread as well. What you probably could do in this situation is setting the ItemsSource Property of the xamComboEditor using the following code:
<Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type igDP:XamDataGrid}}, Path=DataContext.Nummern}" />
You cannot use the DataContext in the resources of the visual elements because they do not inherit FrameWorkElement, so they cannot make a connection with the DataContext of an element.
If you have any further questions on this matter do not hesitate to ask.