Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: Wpf datagrid value background colour [20192]

$
0
0
Hi,
I can't able to set background for a string in Wpf property Grid. Is it is posible to change it?
Comments: ** Comment from web user: BoucherS **

Hi,

If you want to set the background for all the datacells of a specific column, you can specify a CellContentTemplate.
```
//In Resources
<DataTemplate x:Key="employeeDataTemplate">
<Border Background="Red">
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource nameConverter}"
ConverterParameter="FormatLastFirst">
<Binding Path="FirstName" />
<Binding Path="LastName" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</Border>
</DataTemplate>

//In the DataGridColumn
<xcdg:Column FieldName="EmployeeID"
Title="Employee"
Width="160"
CellContentTemplate="{StaticResource employeeDataTemplate}" />
```


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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