DataGridComboboxColumn - Itemsource and ItemTemplate

Jul 15, 2010 at 7:37 AM

Hi,

I'm new to WPF and new to the DataGrid. Great work, y'all!

Here's what I have :

A DataGrid with a few Columns, three of which are DataGridComboboxColumns. Two of the columns should have the same Items-Collection, the third one should have it's own. The items are (as of this writing) defined in the Window class.

// ObservableCollection<Route>
public RouteCollection Routes
        {
            get;
            set;
        }

// ObservableCollection<Endpoint>
public EndpointCollection Endpoints
        {
            get; 
            set;
        }
I wouldn't like to do something like creating dependency properties from those collections and setting this.DataContext = this...it seems rather dirty to do this...
Could anyone help me out with an idea? Is there a best practice that describes a better way of doing this?
Next thing, I can't seem to add a DataGridComboboxColumn.ItemTemplate node. Is this a Text-Only Column-Type? Will I have to go for a DataGridTemplateColumn if I want to customize Item layout?
Any help appreciated!
Thanks in advance