xceedsoftware / wpftoolkit

All the controls missing in WPF. Over 1 million downloads.
Other
3.91k stars 878 forks source link

Wpf datagrid value background colour #661

Open xceedsoftware opened 7 years ago

xceedsoftware commented 7 years ago

sujithjino[CodePlex]
Hi, I can't able to set background for a string in Wpf property Grid. Is it is posible to change it?

xceedsoftware commented 7 years ago

BoucherS[CodePlex]
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} /