Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Datagrid context menu command binding - Dynamic XML

$
0
0

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


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>