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

Datagrid template column combobox background is always grey... How can I change the background color of the combobox?

$
0
0

Hello..

I have a datagrid and one of the columns has a combobox inside a template. I really don't like the background color of the combobox but can't change it!! 

Here is my code:

<!--Vehiculo Combobox--><DataGridTemplateColumn x:Name="vehiculoColumn" Header="Vehiculo" Width="100" SortMemberPath="VehiculoID" CanUserSort="True" ><DataGridTemplateColumn.CellTemplate><DataTemplate><ComboBox SelectedValue="{Binding VehiculoID,NotifyOnSourceUpdated=True, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True}"
                                                  SelectedValuePath="VehiculoID" DisplayMemberPath="VehiculoNombre" HorizontalAlignment="Stretch" 
                                                  ItemsSource="{Binding VehiculosCombo, ElementName=ListarDespachosPG}" Background="Blue" ><ComboBox.ItemContainerStyle><Style TargetType="{x:Type ComboBoxItem}"><Setter Property="Template"><Setter.Value><ControlTemplate><Grid><Grid.ColumnDefinitions><ColumnDefinition Width="50"/><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions><TextBlock Margin="5" Grid.Column="0" Text="{Binding VehiculoID}"/><TextBlock Margin="5" Grid.Column="1" Text="{Binding VehiculoNombre}" /><TextBlock Margin="5" Grid.Column="2" Text="{Binding VehiculoPlaca}" /></Grid></ControlTemplate></Setter.Value></Setter></Style></ComboBox.ItemContainerStyle></ComboBox></DataTemplate></DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn>


Guisselle


Viewing all articles
Browse latest Browse all 18858

Trending Articles



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