Roberto Salemi

Roberto Salemi

  • NA
  • 146
  • 136.7k

[WPF] DataGrid: apply style to text into cell from codebehin

Apr 17 2015 6:56 AM
Hi,
in a dataGrid, can I apply a style to text into cell from code behind?

I know that I can use DataTrigger, but I can't add a new property to model that it is binds with datagrid.

With 
DataGridRow tmpRowSelected = dgProperties.ItemContainerGenerator.ContainerFromItem(dgProperties.SelectedItem) as DataGridRow;

I get my selecte row, I would apply TextDecorations.Strikethrough to text into the cells of this row.

Thanks.

Answers (3)