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
65
ComboboxColumn binding issue "cannot find governing frameworkelement..."
posted

Hi.

I have an issue to bind two custom classes with comboboxColumn.

My custom classes in viewmodel are below:

public class Logic{                                    // this is available selections in combobox column

    privae int no

    private string desc;

    public int No { //getter, setter }

    public string Desc { //getter, setter}

}

private ObservationCollection<Logic> lstLogic;

public ObservationCollection<Logic> LstLogic { // getter, setter }

public class DetailInfo{                                  // this includes real data for showing in grids

   public int idx {get;set;}

   public string name {get; set;}

   ...

   public int logic_no {get;set;}                    

   public string logic_desc {get;set;}               // first selected desc in combobox

}

private ObservationCollection<DetailInfo> lstInfo;

public ObservationCollection<DetailInfo> LstInfo { // getter, setter }

And, in my xaml I binded my custom classes like this.

<ig:XamGrid x:Name="xamGridInfo" ItemSource="{Binding Path=LstInfo, NofityOnTargetChanged=True}">

    <ig:XamGrid.Columns>

        <ig:TextColumn Key="idx" HeaderText="idx" Width="*" IsReadOnly="True"/>

        <ig:TextColumn Key="name" HeaderText="idx" Width="*" IsReadOnly="True"/>

        <ig:ComboBoxColumn Key="logic_desc" HeaderText="logic" ItemsSource="{Binding LstLogic}" DisplayMemberPath="Desc" SelectedValuePath="Desc"/>

    </ig:XamGrid.Columns>

</ig:XamGrid>

Other text columns are shown well, but only a combobox column shows nothing in it.

Also, I got this bug message:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=LstLogic; DataItem=null; target element is 'ComboBoxColumn' (HashCode=608860); target property is 'ItemsSource' (type 'IEnumerable')

What should I do..?

I appreciate for your help in advance.