views:

88

answers:

2

The System.Windows.Controls.Data.DataGrid is used in my Silverlight application, but on attempt to add 'DataGridComboBoxColumn' column to the grid the following error messages are obtained:

Error 1 The tag 'DataGridComboBoxColumn' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data'. C:\Project\Budda\VFMElita\VfmElitaView\Pages\SquadView.xaml 140 22 VfmElitaView

  • Error 2 The type 'data:DataGridComboBoxColumn' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Project\Budda\VFMElita\VfmElitaView\Pages\SquadView.xaml 142 22 VfmElitaView*

Here is my "header" of the xaml-file:

Here is grid:

    <StackPanel Grid.Row="1" Grid.Column="0" Grid.RowSpan="2">
        <TextBlock Text="Поле"/>
        <data:DataGrid AutoGenerateColumns="False" ItemsSource="{Binding FieldPlayers}">
            <data:DataGrid.Columns>
                <!--<data:DataGridTemplateColumn Header="#">
                            <data:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Margin="4" Loaded="TextBlock_Loaded"/>
                                </DataTemplate>
                            </data:DataGridTemplateColumn.CellTemplate>
                        </data:DataGridTemplateColumn>-->
                <data:DataGridTextColumn Header="№" Binding="{Binding Number}"/>
                <data:DataGridComboBoxColumn> - that doesn't work

                </data:DataGridComboBoxColumn>
            </data:DataGrid.Columns>
        </data:DataGrid>
    </StackPanel>

What is required to get 'DataGridComboBoxColumn' workable? Seems like additional reference is required... but which library should be referenced?

Any help is welcome. Thanks.

A: 

Did you try running this msdn sample code with all the namespaces included

Veer
All mentioned namespaces from the msdn sample code are in my example. Aren't it?
Budda
+1  A: 

If I'm not mistaken, DataGridComboBoxColumn exists in WPF, not in Silverlight. Instead, you can use a DataGridTemplateColumn, and define your own template with a ComboBox

Thomas Levesque
It seems like you are correct.
Budda