Cant see the comboxcolumn in my datagrid

69 views Asked by At

I have a datagrid that is bind to a observable collection:

System.Collections.ObjectModel.ObservableCollection<vadcGridListaClass> vadcGridList = new System.Collections.ObjectModel.ObservableCollection<vadcGridListaClass>();

The class of vadcGridListaClass is:

class vadcGridListaClass
{
    public int ID { get; set; }
    public int CU { get; set; }
    public int reals { get; set; }
    public int groups { get; set; }
    public Boolean L7 { get; set; }
    public Boolean VRRP { get; set; }
    public string vrrpType { get; set; }
    public Boolean L3Gateway { get; set; }
    public string healthChecks { get; set; }
    public DataGridComboBoxColumn service = new DataGridComboBoxColumn();
    public List<string> serviceList = new List<string>();
}

My problem is that when I add an item to the vadcList, I see all the columns except the combobox column. The adding values to the list is in this part:

                vadcGridListaClass vadcItem = new vadcGridListaClass();
                vadcItem.CU = 1;
                vadcItem.ID = i;
                vadcItem.groups = 0;
                vadcItem.healthChecks = "ICMP";
                vadcItem.L3Gateway = false;
                vadcItem.L7 = false;
                vadcItem.reals = 0;
                vadcItem.VRRP = false;
                vadcItem.vrrpType = "Main";
                vadcItem.serviceList.Add("HTTP");                   
                vadcItem.service.ItemsSource = vadcItem.serviceList;
                vadcGridList.Add(vadcItem);


at the end I have:
                vadcGrid.ItemsSource = vadcGridList;
                vadcGrid.AutoGenerateColumns = true;

So I can see all the columns in vadcGrid, according to the vadcGridList, but where the service combobox column is supposed to be I get blank column, and I dont know where the problem is.

Amir

0

There are 0 answers