Using Andy O'Neill's example I create a datagrid and fill with data. I can use click events by creating event handlers but I have a context menu where I cannot run commands.
<DataGrid.ContextMenu><ContextMenu><ComboBox Margin="0 10 0 5" Name="lstCurrentMission" ItemsSource="{Binding CurrentMissionList}" SelectedValuePath="MissionID" SelectedIndex="0"><ComboBox.ItemTemplate><DataTemplate><TextBlock><TextBlock.Text><MultiBinding StringFormat="{}{0}: {1}"><Binding Path="MissionNumber"/><Binding Path="MissionName"/></MultiBinding></TextBlock.Text></TextBlock></DataTemplate></ComboBox.ItemTemplate></ComboBox><MenuItem Name="btnAddToMission" Header="Add to mission" Command="{x:Static local:CJCommands.AddToMission}" /><MenuItem Header="Remove from mission" /></ContextMenu>
Since the datagrid is built dynamically I get an error during the build. Message='Provide value on 'System.Windows.Markup.StaticExtension' threw an exception.' It says that Local is not mapped to namespace but I have added "context.XmlnsDictionary.Add("local","xmlns:local=clr-namespace:Schedular");"
I am not sure what I can do to correct this.
:-( Still trying to program