views:

51

answers:

1

I have data being populated into my data grid.Now,In the last column I have data like "Out of Balance " and "Inbalance". I want the display to show all "out of balance" data as being underlined and red in clour while the "in Balance" data to be green in colour without any underline.Note that, the stored proc would give me initially all the "out of balance" records followed by "inbalance" records.please help.I am completely new to the world of WPF and have to give a solution by Monday.Thanks in advance

A: 

You can use a TemplateColumn:

<Controls:DataGrid.Columns>
  <Controls:DataGridTemplateColumn>
    <Controls:DataGridTemplateColumn.CellTemplate>
      <DataTemplate>
        <TextBlock Text="{Binding Data1}" Foreground="Red" TextDecorations="Underline"/>
      </DataTemplate>
    </Controls:DataGridTemplateColumn.CellTemplate>
  </Controls:DataGridTemplateColumn>
</Controls:DataGrid.Columns>
Jalfp