Using datagrid - does not work

Apr 26, 2011 at 2:41 PM
Edited Apr 26, 2011 at 2:44 PM

I simple replaced a basic datagrid view with toolkits datagrid.

No data and no header visible. Please advice.

 

xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
Toolkit Version : 3.5.40128.1

 

 

 

        <DataGrid x:Name="dgv" Grid.Row="1" GridLinesVisibility="Horizontal" ItemsSource="{Binding}" AutoGenerateColumns="False" >
            <DataGrid.Columns>
                <DataGridTextColumn         Header="Key"                    Binding="{Binding Key}"                 Width="SizeToCells"     MinWidth="30" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"   />
                <DataGridTextColumn         Header="English source"         Binding="{Binding English}"             Width="SizeToCells"    MinWidth="80" IsReadOnly="False"     FontSize="12" Foreground="Black" FontWeight="Bold"                  />
                <DataGridTextColumn         Header="Translated"             Binding="{Binding TranslatedLanguage}"  Width="SizeToCells"     MinWidth="80" IsReadOnly="False"    FontSize="12" Foreground="Black" FontWeight="Bold"      />
                <DataGridTextColumn         Header="Auto translated"        Binding="{Binding TranslatedSuggestion}" Width="SizeToCells"    MinWidth="80" IsReadOnly="False"    FontSize="12" Foreground="Navy"       />
                <DataGridTextColumn         Header="Autor"                  Binding="{Binding Autor}"               Width="SizeToCells"     MinWidth="80" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"      />
                <DataGridTextColumn         Header="Autor (edited)"         Binding="{Binding LastEditedBy}"        Width="SizeToCells"     MinWidth="80" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"      />
                <DataGridTextColumn         Header="Edited"                 Binding="{Binding LastEditedDate}"        Width="SizeToCells"     MinWidth="80" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"      />
                <DataGridTextColumn         Header="Extra"                  Binding="{Binding Extra}"               Width="*"               MinWidth="80" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"      />
            </DataGrid.Columns>
        </DataGrid>

<!-- the following is not working -->
        <toolkit:DataGrid Grid.Row="1" x:Name="dgv" GridLinesVisibility="Horizontal" ItemsSource="{Binding}" AutoGenerateColumns="False">
            <toolkit:DataGridTextColumn         Header="Key"                    Binding="{Binding Key}"                 Width="SizeToCells"     MinWidth="30" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"   />
            <toolkit:DataGridTextColumn         Header="English source"         Binding="{Binding English}"             Width="SizeToCells"    MinWidth="80" IsReadOnly="False"     FontSize="12" Foreground="Black" FontWeight="Bold"                  />
            <toolkit:DataGridTextColumn         Header="Translated"             Binding="{Binding TranslatedLanguage}"  Width="SizeToCells"     MinWidth="80" IsReadOnly="False"    FontSize="12" Foreground="Black" FontWeight="Bold"      />
            <toolkit:DataGridTextColumn         Header="Auto translated"        Binding="{Binding TranslatedSuggestion}" Width="SizeToCells"    MinWidth="80" IsReadOnly="False"    FontSize="12" Foreground="Navy"       />
            <toolkit:DataGridTextColumn         Header="Autor"                  Binding="{Binding Autor}"               Width="SizeToCells"     MinWidth="80" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"      />
            <toolkit:DataGridTextColumn         Header="Autor (edited)"         Binding="{Binding LastEditedBy}"        Width="SizeToCells"     MinWidth="80" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"      />
            <toolkit:DataGridTextColumn         Header="Edited"                 Binding="{Binding LastEditedDate}"        Width="SizeToCells"     MinWidth="80" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"      />
            <toolkit:DataGridTextColumn         Header="Extra"                  Binding="{Binding Extra}"               Width="*"               MinWidth="80" IsReadOnly="False"    FontSize="9"  Foreground="LightGray"      />
        </toolkit:DataGrid>

 

codebehind:

 

 Me.dgv.DataContext = Me._LanguageItem.WordCollection'object with working properties in object