I have a DataGrid with a few columns. I do not set the ReadOnly property for the grid or for any columns and while in runtime I can see that the column with the CellEditor ReadOnly property value is False.
However I cannot see the ComboBox im supposed to with the CellEditor. I was worried that maybe some style from controls up in the logical tree might be affecting this so i set "empty" styles for all types just in case but this did not work.
Im including the xaml and I hope you can point out anything that might be wrong or weird. I also wanted to ask if you can point out generally what might be the things that might affect the display of a CellEditor or prevent the DataGrid from entering edit mode.
One more thing. In the grid when I go over a Cell and hit F2 I do see the Row Selector Pane switch to the editting glyph however the CellEditor does not appear.
Here is the xaml, the code behind contains nothing special:
<UserControl.Resources>
<ResourceDictionary>
<xcdg:DataGridCollectionViewSource x:Key="ContractTables" Source="{Binding Path=TableReferences}"/>
<Style TargetType="{x:Type xcdg:DataRow}">
</Style>
<Style TargetType="{x:Type xcdg:DataGrid}">
</Style>
<Style TargetType="{x:Type xcdg:Column}">
</Style>
<Style TargetType="{x:Type xcdg:DataCell}">
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="5">
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Padding="5">
<xcdg:DataGrid Name="grdTables"
NavigationBehavior="RowOrCell"
SelectionMode="Single"
AutoCreateColumns="False"
CellEditorDisplayConditions="MouseOverCell"
ItemsSource="{Binding Source={StaticResource ContractTables}}">
<xcdg:DataGrid.Columns>
<xcdg:Column Title="Table Code"
FieldName="TableCode"
Width="50" />
<xcdg:Column FieldName="IsRequired"
MinWidth="15"
MaxWidth="15">
<xcdg:Column.CellContentTemplate>
<DataTemplate>
<TextBlock Foreground="Red"
Visibility="{Binding Converter={StaticResource BooleanToVisibilityConverter}}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="*" />
</DataTemplate>
</xcdg:Column.CellContentTemplate>
</xcdg:Column>
<xcdg:Column Title="Table Name"
FieldName="TableName"
Width="200" />
<xcdg:Column Title="Table Number"
FieldName="LookupDataSource"
CellEditorDisplayConditions="MouseOverCell"
Width="200">
<xcdg:Column.CellEditor>
<xcdg:CellEditor>
<xcdg:CellEditor.EditTemplate>
<DataTemplate>
<ComboBox/>
</DataTemplate>
</xcdg:CellEditor.EditTemplate>
</xcdg:CellEditor>
</xcdg:Column.CellEditor>
<xcdg:Column.CellContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SelectedKey}"/>
</DataTemplate>
</xcdg:Column.CellContentTemplate>
</xcdg:Column>
<xcdg:Column Title="Selected Table Name"
FieldName="SelectedItemName"
Width="200" />
<xcdg:Column Title="Memo" FieldName="MemoData" Width="60">
<xcdg:Column.CellContentTemplate>
<DataTemplate>
<Image Stretch="None" Width="16" Height="16"
Source="{Binding DocumentationType, Converter={StaticResource DocumentationToImageConverter}}" >
</Image>
</DataTemplate>
</xcdg:Column.CellContentTemplate>
</xcdg:Column>
</xcdg:DataGrid.Columns>
<xcdg:DataGrid.View>
<xcdg:TableView ShowFixedColumnSplitter="False"
ShowRowSelectorPane="True"
ColumnStretchMode="All"
ColumnStretchMinWidth="60"
UseDefaultHeadersFooters="False">
<xcdg:TableView.FixedHeaders>
<DataTemplate>
<xcdg:ColumnManagerRow AllowSort="False" AllowColumnReorder="False" />
</DataTemplate>
</xcdg:TableView.FixedHeaders>
</xcdg:TableView>
</xcdg:DataGrid.View>
</xcdg:DataGrid>
</ScrollViewer>
</Grid>
</ScrollViewer>